Re: Script ERRORLEVEL not working as expexted
Full log file please.
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
. 2025-07-31 02:17:54.795 --------------------------------------------------------------------------
. 2025-07-31 02:17:54.796 Connecting to ingest.example.ca ...
. 2025-07-31 02:18:09.808 Timeout detected. (control connection)
. 2025-07-31 02:18:09.808 Connection failed.
. 2025-07-31 02:22:54.810 --------------------------------------------------------------------------
WinSCP.com
(not .exe
) from the batch file.
cd /d %~dp0
".\WinSCP\WinSCP.exe" /script=.\FTP_Outbound.txt /log=.\FTP_Outbound_log.txt /logsize=5*10M
if %ERRORLEVEL% NEQ 0 (
echo WinSCP transfer failed. Files will not be moved.
exit /b %ERRORLEVEL%
)
cd /d D:\Exports\
rem Move files to Backup folder:
move /Y *.* Backup
ERRORLEVEL
is not equal to 0 but it never work as expected. Please advise.
Timeout detected. (control connection)
Connection failed.
ERRORLEVEL
other than 0 I assume?