如果选项以hypen开头,则批处理文件命令行参数解析错误

时间:2019-04-16 16:18:18

标签: windows batch-file cmd

我具有以下命令来调用可执行文件:

start /wait %arg1%  -c %arg2%

我看到一个错误窗口,指出:

Windows cannot find '-c'. Make sure you typed the name correctly and try again

如何解决该错误-将-c放在单引号或双引号中也无济于事?

我也在命令提示符下尝试过:

.\run.bat "c:\Project Work\bin\test.exe"  c:\config.ini
ECHO is off. 
The system cannot find the file -c.

但是exe和ini文件都存在。

即使在提示符下运行:

start /wait "c:\Project Work\bin\test.exe" -c c:\config.ini

存在相同的问题- Windows无法找到“ -c”。确保您正确输入了名称,然后重试

0 个答案:

没有答案