Ok, I need to test the successful execution of a program within a DOS batch file, print if program fails but continue if program succeeds.
Pseudo-code;
program.exe # program that is executed and status to be checked
IF %ERRORLEVEL NEQ 0 ECHO "I failed" EXIT # check status
otherwise continue with batch job
....
Need code example because DOS is driving me crazy ... should be simple but I am using
myprogram.exe
@IF %ERRORLEVEL% NEQ 1 GOTO ERROR
@IF %ERRORLEVEL% EQ 0 GOTO OK
:ERROR
ECHO "Program failed, please check this log file for errors ..."
GOTO END
:OK
mynestprogram.exe
:END
and it is not working
--------------------------------------------------------------------------------