How do you stop a Windows Batch file from exiting early?

梦想与她 提交于 2019-12-03 22:13:41

You can use DOS call command:

@echo off
call C:\DoStuff.cmd
echo Exit Code = %ERRORLEVEL%

After getting error code you can proceed for example with:

if "%ERRORLEVEL%" == "1" exit /B 1
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!