There are two batch files: a.bat and b.bat. In b.bat, call a.bat. Now I want that if an exception occurs in a.bat when calling a.bat, it won't return to b.bat. I don't know how to implement this.
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!
call a.bat || goto :eof
@echo off
Call 2.Bat 02
:: Judge whether the called 2.Bat runs successfully. As long as there is a preset errorlevel return value, it runs successfully!
if %errorlevel%==1000 ( echo 2.Bat executed successfully! ) else ( echo 2.Bat failed to run! )
@echo off
if == exit /b
goto :%1
:01
echo 01 label segment
goto :end
:02
echo 02 label segment
goto :end
:end
exit /b 1000