I've tried deconstructing things to see what's happening. By writing a
much-simplified function and changing "c" to "k" to keep the console open, I've
discovered some really strange behavior.
I added the full Java path ("C:/Program Files/Java/jde1.6.0_07/bin/java.exe") as
a variable. Then I put a test file in the same directory as the yuicompressor.
(D:/PSPad editor/bin).
If I call yuicompressor on just bin/file.js, everything works fine. But if I put
the full path in, one of two things happens. If I don't wrap the filename (and
output name) in quotes, yuicompressor can't find the file, which is what you'd
expect.
But, if I do wrap it in quotes, escaped or not, cmd.exe can't find java.exe. It
throws an error "C:\Program is not recognized ...", just as if I hadn't quoted
the Java path. But, surprisingly, the same command string works fine when run in
the console itself.
And this is just for local files. All the files I'm likely to want to compress
are on my networked development server, which may make things even harder.
--
<http://forum.pspad.com/read.php?2,51923,51995>
PSPad freeware editor http://www.pspad.com