I’ve got a MS DOS command line issue, I’m trying to pass some arguments to a console application from a batch file as below (notice that [xemSA]” is actually on the previous line, stackoverflow is putting it on another line) :
SET server=devmos
UploadToDevMos.exe /server=server% /file="~dpdocuments\Word2003.doc" /querystring:"frequentlyused=0&clienttemplate=0&DocType=Minute&doctype=Minute&clientcodes=[xemSA]"
However when I run the batch file notice that the /querystring has disappeared and spaces have been put around the &
C:\Temp\SJ\TestRunner\bin\Debug>SET server=devmos
C:\Temp\SJ\TestRunner\bin\Debug>UploadToDevMos.exe /server=devmos /file="C:\Temp
\SJ\TestRunner\bin\Debug\"frequentlyused=0 & clienttemplate=0 & DocType=Minute
& doctype=Minute & clientcodes=[JTCLuxemSA]"
How can I pass these arguments in a batch file correctly?
Kind regards
Simon Jackson
It’s something to do with the
~dp0not expanding as expected. I think you missed the “0”I changed my test to this, and it worked okay: