我想运行一个批处理文件,该文件启动4个其他批处理文件。 问题:只有第一个CMD文件被执行。如何使用RootPath在bat文件中运行多个bat文件
我看着这里发表类似的问题:How to run multiple .BAT files within a .BAT file
这里:How do I launch multiple batch files from one batch file with dependency?
我的问题不同的是,我沿着每个CMD文件ROOTPATH通过。
Examples given in other posts:
call msbuild.bat
call unit-tests.bat
call deploy.bat
My code:
SET RootPath="G:\Dev Folder\Framework\MainFolder\SubFolder\JOBS\"
CALL %RootPath%Account.CMD
CALL %RootPath%Customer.CMD
CALL %RootPath%Contract.CMD
CALL %RootPath%Location.CMD
包含代码这Master.CMD文件不在同一目录中的帐户/客户/合同/位置CMD文件,这就是为什么我传递的绝对路径。 第一个命令运行得很好。然后我得到的错误:
'..\Customer.CMD ' is not recognized as en internal or external command, operable program or batch file.
'..\Contract.CMD ' is not recognized as en internal or external command, operable program or batch file.
'..\Location.CMD ' is not recognized as en internal or external command, operable program or batch file.
我不能从其他批处理帖子推演出的解决方案在stackoverflow。我不熟悉这种语言,请原谅我是否忽略了某些内容。
任何和所有的帮助是受欢迎的。
RootPath里面有一个空格。尝试使用引号“CALL”%RootPath%Account.CMD“'。 –
这看起来像你的'ACCOUNT.CMD'重置'RootPath'.Env变量是全局变量,除非你用'setlocal'将它们隔离开来。 – wmz
RootPath值有引号。 此外,为** CALL“%RootPath%Account.CMD”添加引号**似乎无法解决问题 – NetFlash