Capture Errorlevel

Advertisement

kokloong
Guest

Capture Errorlevel

How can I capture the errorlevel or exit code? I'm trying to get the errorlevel for tracing and monitoring as well as documentation for my ftp processes.

I tried with as below in my script but it doesn't echo the error code although there is an error occured

##ftp process##
if %errorlevel% NEQ 0 goto error

goto end
:error
echo exit with code %errorlevel%

:end
exit    

Reply with quote

Advertisement

You can post new topics in this forum