1.

Solve : Exit Code?

Answer»

How can I check the exit code/return value from a program being executed in a batch file?

Thanks very much!Try CHECKING the ERRORLEVEL value in reverse sequence. Note that all programs do not issue ERRORLEVELS and even Microsoft UTILITIES use them haphazardly. In general a value of zero indicates all is well; anything else is a sign of problems.

Code: [Select]program
if errorlevel 1 GOTO problem
if errorlevel 0 goto AOK

:Problem
.
.
goto end

:AOK
echo Everything OK
goto end

:End



Discussion

No Comment Found