Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

Re: Script doesn't abort on fail when using 'option batch abort'

That's by purpose. This is error from which WinSCP can recover (reconnect and resume transfer), so it tries that.

You can disable this by setting option reconnecttime to short interval.
https://winscp.net/eng/docs/scriptcommand_option
StijnNeirinck

Script doesn't abort on fail when using 'option batch abort'

Script:
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connection
open ftp://Firma064:meZ15(J1)d@217.7.154.116 -passive=on
# Change remote directory
cd /Orders/test
# Upload the file to current working directory
put F:\EDI\VIEGA\OUT\ORDER\*.txt
# Disconnect
close
# Exit WinSCP
exit


Command:
winscp.com /script="F:\WINSCP\EDI\VIEGA\UPLOAD.TXT" /log="F:\WINSCP\EDI\VIEGA\upload.log"

Output:
batch abort
confirm off
Connecting to 217.7.154.116 ...
Connected with 217.7.154.116. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] Firma064@217.7.154.116
/Orders/test
F:\...\8601827122.txt | 0 B | 0,0 KiB/s | binary | 0%
Lost connection.
Timeout detected.
Copying files to remote side failed.
(A)bort, (R)econnect (1 s):


WinSCP, Version 5.5.0 (Build 3839)


What am I doing wrong?[/u]