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

« Next Oldest | Next Newest »

Messages In This Thread
Useless commands == Decent coding or useless? - Firefox Wins - 01-31-2011 01:39 AM

 Standard Tools
Forum Jump: