I got myself into trouble trying to catch the return code from
winscp.com(latest version 5.18.5).
My script works fine but when I'm trying to make the winscp part fail (for testing purposes,
@IPis voluntarily a false one), it indeed fails (connection fails) but still returning
My script looks like this:
"%repdev%\WinSCP.com" ^ /log="%replog%\FTP_%soc%_%tagdate%.log" /loglevel=2* /logsize=10*10M ^ /command ^ "option batch abort" ^ "open ftp://root:XXXXXXX@220.127.116.11/" ^ "cd /ud/tmp/LBE" ^ "put -transfer=binary PDF%soc%.001" ^ "put -transfer=binary PDF%soc%.flw" ^ "exit" if %ERRORLEVEL% NEQ 0 GOTO :ERREUR_FTP
I tried the same using
/scriptwith a txt instead of
/commandbut the result is the same.
Any ideas what's wrong with my script? Or am I misunderstanding the way WinSCP deals with failed connection?