E isso? XP ou superior exigido, claro ...
if %errorlevel% GEQ 1 (
if %errorlevel% NEQ 255 goto :NotClosed
::other statements go here, if you need 'em
::don't forget to close the parenthesis on the last statement ->)
Para esclarecer mais:
if %errorlevel% EQU 0 (
::commands you want to perform if 0 go here. Notice ->)
else (
::We got here because errorlevel was GEQ 1 or less than one...watch out
::if you program returns negative errorlevels!
if %errorlevel% NEQ 255 goto :NotClosed
::other statements go here. But don't forget the parenthesis ->)