Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Sasidharan9513

Capturing WinSCP return code in the script

Hi There,

Is there any possibility to capture the WinSCP.com commandline return code?

I need to fail the automated process based on the return code.

Can some one let me know the answer/sent me a same script which uses the return code?
winscp.com /console /script="C:\Winscp_testing\WinSCP_script.txt" /xmllog="C:\Winscp_testing\log1.xml"

WinScp_Script.txt has the below code:
# Abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
open sftp://usename:pwd@abc.com
# Change remote directory
cd cps_dev
# Download file to the local directory
mv *.pdf C:\Winscp_testing\
# Disconnect
close
# Exit WinSCP
exit