Topic "Automatic Retry in Script"

Author Message


I am using a combination of a saved session and a script to upload a file.

Here's my script:

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
lcd c:\winnt
# Upload the file to current working directory
put test.txt
# Disconnect
# Exit WinSCP

Now, when I connect to the server, it's always slow, so it asks me: "Wait for another 15 seconds?"

Once I hit "R" to retry, it connects successfully. How can I incorporate this into my script, so I don't always have to be the one pressing "R"?

Thanks for your help!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
I suppose that you open the session via command line parameter, so before the "option batch on" takes effect. Use command "open" instead and place it after the "option batch on".
Martin Prikryl


When prompted with the following,

(A)bort, (R)etry, (S)kip, Ski(p) all

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