C>SET ST_HOME="C:\Program Files\Segue\SilkTest" C>%ST_HOME%\partner
Partner.exe runs, then says "Unable to locate \partner". It expands, of course, to "C:\Program Files\Segue\SilkTest"\partner.exe.
C>"C:\Program Files\Segue\SilkTest\partner"
This, of course, works.
C>C:\Program Files\Segue\SilkTest\partner 'C:\Program' is not recognized as an internal or external command, operable program or batch file. C>"%ST_HOME%\partner" '""C:\Program' is not recognized as an internal or external command, operable program or batch file.
These, of course, do not.
At least we always have the old standby, never fails1:
C>SET ST_HOME=C:\Progra~1\Segue\SilkTest C>%ST_HOME%\partner
Unless...
C>SET ST_HOME="C:\Progra~1\Segue\SilkTest" C>%ST_HOME%\partner
Runs partner.exe, then partner.exe says "Unable to locate \partner".
I wasn't expecting this to get put up on reddit, especially after having written it two years ago and just repasting it on IRC for kicks. Some people made some snotty responses suggesting that I was a moron for not reading the documentation (apparently missing the point) and I responded accordingly. Some other people intimated that I was a moron because Windows didn't need a useful command line (seriously, what?). So maybe I do come off as having "sand in my vagina," but it's pretty funny to be called an idiot for simply highlighting what I find to be particularly poorly-thought out behaviors—and for god's sake, I used to do a ton of Bourne shell scripting, so I'm pretty accustomed to brain damage. There are plenty of other programs that serve as examples of Windows command line insanity even if they have nothing to do with cmd.exe itself; I particularly like "sc": it wants foo= bar—not foo = bar, not foo=bar, but only foo= bar.
Is the reason because, apparently, the average command line user refuses to read the error message?
The right thing to do is, yes, to not include the quote marks when SETting the variable. That doesn't mean it's not totally retarded.
Umm, the command line isn't meant to be taken seriously, that's what WSH is for.
I want to cut off your fucking hands. Suggesting that one use WSH is worth only a jwz-style response as this.
Use a real shell: (or cygwin if stuck on windoze):
I wasn't about to install bash for a simple run script.
I just tested this and found that it does work as expected.
Congratulations, it works with your trivial test. It didn't work with SilkTest! (This is SilkTest's fault, but I challenge you to find a UNIX app similarly brain-damaged.)
Runs partner.exe, then partner.exe says "Unable to locate \partner"
The last bit really is my favorite. I don't even want to know why cmd.exe treats "C:\foo\"bar differently from C:\foo\bar.
And finally:
I like how the author felt the need to respond to all 4 comments on this thread (other than mine, at the time that I wrote this).
Do I get a response? PLEASE? PRETTY PLEASE?
Sure: you're a cunt.
1: This isn't entirely true either. If you disable creation of 8.3 file/directory names (don't do this, it causes countless programs to crash and burn), anything created after that point won't work with the ~n trick. Better yet, if you turn it back on, new files/dirs will have 8.3 fallback names, but the things made before turning it back on still won't.