Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

tnelson@cina-us.com

Solved

You are absolutely correct. Problem solved!
martin

Re: errorllevel not being returned

Why do you use start to run WinSCP? It's no used in any example on this site. Remove it.

The start launches WinSCP asynchronously not waiting for its exit. So when testing exit code, you are actually testing exit code of the previous command, the echo, that is always 0.

See also:
https://winscp.net/eng/docs/guide_automation#results
tnelson@cina-us.com

errorllevel not being returned

I am having trouble getting WINSCP to pass the errorlevel back from execution. I have put in echoes after the execution that displays the errorlevel. It always displays zero. However, the log says it is a 1.

HELP!!


echo Running OCS FTP
start C:\"Program Files (x86)"\WinSCP\winscp.com /script=D:\FTP\Optum\OCSFTPDownload.txt /log=D:\FTP\Optum\OCSLog.txt
if errorlevel 1 goto error
goto end
:error
echo fail
:end