I am writing a batch file which validates a couple of files. When one of the file isn't valid, I want the batch script to stop and return an error code >0. The code below seem to do the job, but calling "EXIT 2" closes the Command Prompt window in which the script was running.
:Validate
SETLOCAL
Validator %1
IF %ERRORLEVEL% GEQ 1 EXIT 2
ENDLOCAL
Any idea on how to return an error code without closing the Command Prompt?