LoRd_MuldeR
5th April 2011, 16:11
Mug Funky,
if you want to execute/skip certain commands in your batch file based on an applications return value (exit code) you can also check the %ERRORLEVEL% variable for this purpose.
But be aware when using %ERRORLEVEL% or other variables in a FOR loop, because the Windows batch interpreter will expand variables before entering the loop!
BTW: Whether the application writes its output to the 'stdout' or the 'stderr' doesn't matter for the exit code at all. Also both, stdout and stderr, end up on the console by default.
if you want to execute/skip certain commands in your batch file based on an applications return value (exit code) you can also check the %ERRORLEVEL% variable for this purpose.
But be aware when using %ERRORLEVEL% or other variables in a FOR loop, because the Windows batch interpreter will expand variables before entering the loop!
BTW: Whether the application writes its output to the 'stdout' or the 'stderr' doesn't matter for the exit code at all. Also both, stdout and stderr, end up on the console by default.