Topic "Capture Errorlevel"

Author Message
kokloong

Guest


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

Code:

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

goto end
:error
echo exit with code %errorlevel%

:end
exit
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24995
Location: Prague, Czechia
You may need to have shell extensions enabled for this syntax.

For simpler syntax that works always see
https://winscp.net/eng/docs/guide_automation#results
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License