Get exit status of last executed command in Windows?

Use the errorlevel environment variable:

echo %errorlevel%

This question on stackoverflow has more detailed information.