MSDOC批处理文件控制台应用程序参数问题
我遇到了 MS DOS 命令行问题,我正在尝试从批处理文件将一些参数传递给控制台应用程序,如下所示(请注意,[xemSA]”实际上位于上一行,stackoverflow 将其放在另一行) :
SET server=devmos
UploadToDevMos.exe /server=server% /file="~dpdocuments\Word2003.doc" /querystring:"frequentlyused=0&clienttemplate=0&DocType=Minute&doctype=Minute&clientcodes=[xemSA]"
消失,并且 & 周围已放置空格,
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]"
如何在批处理文件中正确传递这些参数?
但是,当我运行批处理文件时,
请注意 /querystring已
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这与
~dp0
未按预期扩展有关。我认为你错过了“0”我将我的测试更改为这个,并且效果很好:
It's something to do with the
~dp0
not expanding as expected. I think you missed the "0"I changed my test to this, and it worked okay:
您的参数之一使用
=
,另一个使用:
,例如/file=
和/querystring:
。我怀疑他们俩应该使用同一个角色。one of your parameters is using
=
and the other one is using:
like/file=
and/querystring:
. I suspect both of them should use the same character.