3

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

Mohammad AL-Rawabdeh
  • 1,612
  • 12
  • 33
  • 54

1 Answers1

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