MyBB Hacks

Full Version: Useless commands == Decent coding or useless?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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:
// 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?
I'm pretty sure that's not required, you can have multiple sets of double quotes normally.
Reference URL's