Useless commands == Decent coding or useless?
Firefox Wins Offline
Member
***
Posts: 164
Joined: Mar 2008
Post: #1
Useless commands == Decent coding or useless?
I am using a bit of (local) PHP to help control my Windows computer, and found this on php.net:

...user contributed / not 'official' php code.

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
// If you want to use multiple sets of double quotes, there is a nicer workaround than using batch files (.bat). 
// Simply append a useless command in front.

system('[useless command] & [desired command]');

// The useless command may be like "c:" or "cd".
// Example:
system('c: & "C:\Program Files\..." "parameter 1" "parameter 2"');
// or

exec('c: & "C:\Program Files\..." "parameter 1" "parameter 2"');

~Source

Is this really a nice workaround?
IMO, batch files (.bat) are fun.  Tongue

  • Would anyone here ever add "useless code" to any type of script?
01-31-2011 01:39 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Useless commands == Decent coding or useless?
I'm pretty sure that's not required, you can have multiple sets of double quotes normally.

My Blog
01-31-2011 08:16 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: