Not getting errorlevel 1 from exception
Hi,
I generate the following script from external program:
It is called with the following batch which is also generated from external program:
Both script and batch are working fine. To evaluate exception handling with the error file, I specified wrong server path on purpose in the WinSCP script. As expected, I get the following exception in my log:
I generate the following script from external program:
It is called with the following batch which is also generated from external program:
@echo off \\censored\WinSCP\WinSCP.exe /log="\\censored\WinSCP\censored\log\WinSCP_DEV_!D_!M_!Y_!T.log" /ini=nul /script="\\censored\WinSCP\censored\scriptname.txt" if ERRORLEVEL EQ 1 echo ERRORLEVEL>\\censored\WinSCP\censored\sftpError.txt
However, no error file is created. I've also used different approaches to try to create error file. As they have worked in the past, I am pretty sure it is not about my script but about how WinSCP throws the Errorlevel. It seems like WinSCP doesn't return Errorlevel=1. Can you tell me why is that?(Exception) **Expected host key was not configured, use -hostkey switch.**