print exit code in cmd in windows os ....some command return exit code ...where this code store...and i want to print this exit code and assign it to variable

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

echo %ERRORLEVEL%

link|improve this answer
Note that this will be overshadowed if a variable named ERRORLEVEL already exists. So be sure to clear such a variable beforehand for maximum robustness. – Joey Dec 15 '10 at 0:06
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.