我的批处理脚本中有这两行:
call pre.bat
call post.bat
我在pre.bat
(即exit 255
)
即使post.bat
退出并显示错误代码,如何执行pre.bat
?
答案 0 :(得分:6)
在pre.bat
中使用exit /b 255
代替exit 255
如果您无法更改pre.bat,则可以使用start /b /wait pre.bat
代替call pre.bat
。但是,pre.bat可能对环境变量所做的所有更改都将丢失。