Thank you for the response.
Here is the batch script that I am executing:
-------------------------------------------------
%comspec% /c winscp /command "echo @@@@@@ Setting command options: " "option confirm off" "option batch abort" "option exclude */" "echo @@@@@@ Connecting to FTP server: " "open USERNAME:PASSWORD@FTP.SERVERNAME.COM" "echo @@@@@@ Setting local directory: " "lcd D:\FTPJobs_ScriptLibrary\TEST\Inbox\" "echo @@@@@@ Setting remote directory: " "cd Example/Test/" "echo @@@@@@ Setting file transfer mode: " "binary" "echo @@@@@@ Listing contents of remote directory: " "ls" "echo @@@@@@ Transferring file(s): " "get *.pgp -nopermissions -nopreservetime" "echo @@@@@@ Disconnecting from FTP server: " "bye" /log="WinSCP_SessionLog.txt" & echo FTP Session (WinSCP) ERRORLEVEL: %ERRORLEVEL%
-------------------------------------------------
And as can be seen, I am capturing the session errorlevel in the last statement. It receives a value of 0 and I am also capturing the exit code from within the VBScript which runs this batch script (by using Shell.Exec and Exec.ExitCode) and that receives a value of 0 as well.
However, in the (attached) WinSCP logs, I see that the exit code which is actually returned is 1. Not sure what the problem is. Please let me know what could be causing this and how to correct this.
Thank you very much indeed, for the kind support.
Cheers!
Sairam