I have written a .bat
file to first run a program, if it is correctly finished I run another program and check return value of it.
first-program.exe
IF "%ERRORLEVEL%"=="0" (
second-program.exe
IF "%ERRORLEVEL%"=="0" (
ECHO OK
) ELSE (
ECHO NOK
)
)
However the second %ERRORLEVEL%
is always equal to first, it doesn't set to the return value of second-program.exe
.