Hi all,
I want to use a user command to post-process the axf file. I enclose the command in quotes to preserve spaces in the path. However, if I also use quotes to enclose parameters in quotes, then the external command does not get called. If I don't enclose the parameters in quotes, the external command is called but the parameter is not parsed correctly.
As an example, a batch file called test_cmd.bat:
echo Parameter 1 = %1 echo Parameter 2 = %2
If I call this using
"C:\nXDS\nXDS Interface Processor\Application\Release\test_cmd.bat" #L
I get
User command #2: "C:\nXDS\nXDS Interface Processor\Application\Release\test_cmd.bat" C:/nXDS/nXDS Interface Processor/Application/Release/Obj/nXDS.axf C:\nXDS\nXDS Interface Processor\Application>echo Parameter 1 = C:/nXDS/nXDS Parameter 1 = C:/nXDS/nXDS C:\nXDS\nXDS Interface Processor\Application>echo Parameter 2 = Interface Parameter 2 = Interface ".\Release\Obj\nXDS.axf" - 0 Error(s), 0 Warning(s).
The batch file is called but the parameter is split by the spaces.
If I call using
"C:\nXDS\nXDS Interface Processor\Application\Release\test_cmd.bat" "#L"
User command #2: "C:\nXDS\nXDS Interface Processor\Application\Release\test_cmd.bat" "C:/nXDS/nXDS Interface Processor/Application/Release/Obj/nXDS.axf" --- Error: User Command terminated, Exit-Code = 1 ".\Release\Obj\nXDS.axf" - 1 Error(s), 0 Warning(s).
The batch file does not appear to have been called when both the command and parameter are in quotes.
Apart from the obvious workaround of not using a path containing spaces, is there any solution for this problem?
Regards
Win7 doesn't have "command" anymore to switch to a "real" MS-DOS prompt.
Not so. Win7 32-bit still has it. Only 64-bit versions of Windows don't have it --- and that's because the hardware doesn't support 16-bit programs in the CPU mode 64-bit Windows needs to be in.
But ultimately, that's beside the point. The real problem is that Microsoft's command line shells all suck at handling blanks inside command line arguments. cmd.exe (as of W2K) doesn't suck nearly as badly as command.com, but it's still nowhere near sufficient.