24

Is there something like Unix's echo $? in Windows?

27

Use the errorlevel environment variable:

echo %errorlevel%

This question on stackoverflow has more detailed information.

0

On Powershell you can use:

$LastExitCode

variable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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