Stop .bat Files from Closing on Error


Very frustrating when trying to run an application and the window blinks on and off so fast that you can’t see whats happening.

Here’s a way to programatically avoid that:

[some command ] || goto ERR

:ERR
echo.
echo ERROR: Something failed. Exit code %ERRORLEVEL%
pause
exit /b

Leave a Reply

Your email address will not be published. Required fields are marked *