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
Asked
Active
Viewed 2,399 times
1 Answers
4
echo %ERRORLEVEL%

user9517
- 115,471
- 20
- 215
- 297
-
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 00:06