>> WinSCP does return exit code 1, when there is a failure.
>> If you have a problem with testing the exit code, show us your code.
Fair enough.
Here is the powershell code:
winscp.exe /script=.\winTestScript.txt
Write-Output "WinSCP.exe ExitCode = $LastExitCode"
And here is the winscp.exe script (exactly one line):
open ftp://cowg_lists:"bad"@ftp.url.com:12345/
When this executes, the powershell output line is:
WinSCP.exe ExitCode =
Showing NOTHING after the equal sign, which shows that there is no exit code, not 0, not 1, nor anything else.
If I change the powershell code to:
winscp.com /script=.\winTestScript.txt
Write-Output "WinSCP.com ExitCode = $LastExitCode"
and use the exact same winscp script, the result is:
Connecting to ftp.url.com:12345 ...
Connection failed.
Timeout detected. (control connection)
Connection failed.
WinSCP.com ExitCode = 1
[Edited to remove a possible ambiguity:]
My conclusion is that WinSCP.com works correctly by returning an exit code = 1 for this error. WinSCP.exe does not return any exit code at all for the one-line script shown above. If the one-line script is modified so it works correctly, WinSCP.exe still does not return an exit code. WinSCP.exe should return an exit code in all cases.