That's the thing; it works fine when the commands are in a command/dos box. This
works (simplified to just show the YUIcompressor help):
"C:/Program Files/Java/jre1.6.0_07/bin/java.exe" -jar "D:/PSPad
editor/bin/yuicompressor-2.4.2.jar" -h
But if I put it into the script and call it with WSH.run like
sh.run('cmd /k "C:/Program Files/Java/jre1.6.0_07/bin/java.exe" -jar
"D:/PSPad editor/bin/yuicompressor-2.4.2.jar" -h');
it fails with the message
cite:
--------------------------------------------------------------------------------
'C:/Program' is not recognized as an internal or external command,
operable program or batch
file.--------------------------------------------------------------------------------
Adding a file to compress gives the same message.
What seems to be happening is that the opening quote of the Java path closes the
opening quote of the command. Neither using single and double quotes or escaping
the path quotes works. The only sure fix seems to be renaming the directories
with spaces in their names, but doing that would cause numerous problems with a
working computer. :-)
--
<http://forum.pspad.com/read.php?2,51923,52040>
PSPad freeware editor http://www.pspad.com