Pass arguments with white spaces to batch file
I am so sure answer is as simple as passing "" to the arguments in batch file. But this fails. Here is what I am trying to do.
Test.bat env "Some cmd"
This "Some cmd" is ano开发者_Python百科ther command that needs to run in environment set by env.
Test.bat:
Something like set Env with %1%
set cmd=%2%
%cmd%
The above fails with '"Some cmd"' is not recognized as a cmd.
Only way I can get this to work is if I use "%cmd%" in batch file. Is this right?
I think you need to specify path where "Some cmd" is present.
精彩评论