|
From: John B. <joh...@ho...> - 2014-06-26 09:05:25
|
On Thu, 26 Jun 2014 09:25:34 +0300 , Yuri Kanivetsky wrote: > >> Another, perhaps easier workaround is to write your command, as you'd >> type it at the cmd.exe prompt, to a batch file, and then invoke >> cmd.exe to run that batch file. If you keep the batch file's name >> without whitespace, the command that invokes it can side-step the >> quoting issue altogether. >> >> It should work out even if it contains spaces, as long as I quote them. >> >> When you are done, delete the batch file. > > It's not a script to be run once. It's to be executed from time to time. > Let your script generate the .cmd file when it runs: echo "myprog \"arg 1\" arg2"> test.cmd cmd /c test.cmd # will execute myprog "arg 1" arg2 rm test.cmd Regards, John Brown. |