If you're going to modify the program, you might as well just pass the errorlevel as a parameter.
>cmd /c exit 5 >echo %ERRORLEVEL% 5 >perl -le"print @ARGV" %ERRORLEVEL% 5
In reply to Re^2: access to ERRORLEVEL on Win32
by ikegami
in thread access to ERRORLEVEL on Win32
by gkraus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |