Topic "Error trapping during Automated Script"

Author Message
doug

Guest


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
close
# Exit WinSCP
exit
------------------

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

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License