Topic "Error trapping during Automated Script"

Author Message


I need to automate SFTP using Winscp. I have created a script file that turns BATCH on and CONFIRM off and the file is uploaded. Problem is, this will be an unattended process. I need a way of determining if there were any errors and then report it to proper personnel. How do I determine if there were any errors.

Here is my script:
# Automatically answer all prompts negativelly not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with previous
option confirm off
# Force binary mode transfer
option transfer binary
# Upload file to current working directory
put c:\data\temp\test.txt
# Disconnect
# Exit WinSCP

I am calling Winscp from within Visual FoxPro with its run command.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
WinSCP returns exit code 1 on any error. Please refer to the documentation.
Martin Prikryl

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License