forwash.blogg.se

Exit and continue to windows rollback
Exit and continue to windows rollback










exit and continue to windows rollback

You only need to create a syntax error, for example with an empty block (), to suppress the error message, it can be executed in a call, and the stderr of the call is redirected to nul. You can stop a batch at any point, also inside of nested function calls.

exit and continue to windows rollback

Now, when running it, the exit /B 1 simply exits the function, but not the batch file.ĭo you know how to exit the complete batch file without having to copy/paste my "if errorlevel 1." at every step?įor a good solution see the part improved version The problem is this: the error checking is made through a function: :interactive_checkĮcho /!\/!\/!\/!\/!\/!\/!\/!\/!\/!\/!\/!\/!\Įcho Error in compilation process. So I made a function to check errorlevel instead of copy/pasting it at every step. There's 6 or 7 of these (and it might grow). call the "check error level" function and if errorlevel 1, exit.It builds several programs automatically by doing something like this:












Exit and continue to windows rollback