Thursday, April 28, 2011

Halt DOS batch execution on error

In order to halt DOS batch file on error, I used the following syntax

svn up
IF NOT ERRORLEVEL 1 GOTO SVNDONE
ECHO An error occurred with exit code 1 or higher while executing command 'svn up'
GOTO FINAL
:SVNDONE
ECHO SVN Update is successful.

:FINAL
echo DOS batch file execution finished.