I have a similar problem like this How do I escape spaces in command line in Windows without using quotation marks?
But it seems I can't use the carets
C:\>C:\Program^ Files^ (x86)\Adobe\Reader^ 11.0\Reader\AcroRd32.exe
C:\Program Files is not recognized as an internal or external command, operable program or batch file.
cd works fine:
C:\>cd C:\Program^ Files^ (x86)\Adobe\Reader^ 11.0\Reader\
C:\Program Files (x86)\Adobe\Reader 11.0\Reader>
I'm calling the Adobe Reader from C++ App with
UniString cmd("\"C:\\Program Files (x86)\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\" ");
system(cmd.ToCStr());
This is OK, Adobe reader started. But when I add another escaped quotes to pass the argument path to pdf
UniString cmd("\"C:\\Program Files (x86)\\Adobe\\Reader 11.0\\Reader\\AcroRd32.exe\" \"");
cmd.Append("A\\B with space\\C\\test.pdf");
cmd.Append("\"");
system(cmd.ToCStr());
I got
C:\Program is not recognized as an internal or external command, operable program or batch file.
What is going on here? Why can't I use the carets or escaped quotes more times?
(Geez, I hate windows so much)