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
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