%ERRORLEVEL% is always 0
Hello
I have a problem.
I'm using the below script.
But
I want to get the real error code.
Please advise.
Thank you.
I have a problem.
I'm using the below script.
"F:\Tools\WinSCP_51710\WinSCP.com" ^ /log="F:\Tools\WinSCP_51710\WinSCP_51710.log" /ini=nul ^ /command ^ "option batch abort" ^ "open ftp://%ftp_username%:%ftp_password%@%FTP_IP% -explicit -certificate=*" ^ "ls "%FTP_DIR_LIVE%"" ^ "exit" set WINSCP_RESULT=%ERRORLEVEL% if %WINSCP_RESULT% equ 0 ( echo Success ) else ( echo Error ) ECHO ERRORLEVEL %ERRORLEVEL%
%WINSCP_RESULT%
is always 0 even if the log remains "Script: Exit code: 1".
I want to get the real error code.
Please advise.
Thank you.