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

EricB

[RESOVED] with workaround

I had to integrate a filetransfer in a VB6-Component and catched the OutputDataReceived-Event.

When Substring "(A)bort" was part of the message-content, I send a Abort-call


Private Sub oSession_OutputDataReceived(ByVal sender As Variant, ByVal e As WinSCPnet.OutputDataReceivedEventArgs)

    Dim lMsg$
    lMsg = e
    If InStr(lMsg, oOption.Password) Then lMsg = Subst(lMsg, oOption.Password, String(10, "*"))
    If InStr(lMsg, "(A)bort") Then
        oSession.abort
    End If
    Debug.Print Timer, "Session_OutputDataReceived", lMsg
End Sub
martin

Re: Despite "option batch abort", it always reconnects

AaronO wrote:

I'm also having a similar issue. With version 5.5.3:4214 I'm seeing that no matter if I have "abort" or "continue" or anything else, it will always try to reconnect. I've used "option reconnecttime 1" as an interval, because I want it to abort.

It does, indeed, try forever. My log file was about 6GB. :)

Is there another way to "on error abort"? I do not wish for it to try to reconnect at all... the scheduler will try to rerun the batch at a later time anyway.

Attached, I have a screenshot of my batch file run manually. If I punch in an "A" at the right moment, it will abort and exit. If not, it will continue running into perpetuity... or until the network connection gets fixed.

Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
AaronO

Despite "option batch abort", it always reconnects

Hello everyone,

I'm also having a similar issue. With version 5.5.3:4214 I'm seeing that no matter if I have "abort" or "continue" or anything else, it will always try to reconnect. I've used "option reconnecttime 1" as an interval, because I want it to abort.

It does, indeed, try forever. My log file was about 6GB. :)

Is there another way to "on error abort"? I do not wish for it to try to reconnect at all... the scheduler will try to rerun the batch at a later time anyway.

Attached, I have a screenshot of my batch file run manually. If I punch in an "A" at the right moment, it will abort and exit. If not, it will continue running into perpetuity... or until the network connection gets fixed.

Thanks!
Aaron
martin

Re: Abort on Error - same result with all "option batch" options

martin wrote:

Do you get the prompt for open or put? If for put, try
option reconnecttime off
https://winscp.net/eng/docs/scriptcommand_option

This answer was actually wrong, you need to set option reconnecttime to show interval instead.
DanielGow

It was definitely on the put command, open was connecting and opening the session without any trouble. It's also only in the situation where put fails on a timeout. Put failing due to other reasons will abort with "option batch abort", but timeouts were causing it to reconnect. I'll give "option reconnecttime off" a try.

Thanks!
Dan
DanielGow

Abort on Error - same result with all "option batch" options

Hello,

I am running WinSCP version 4.3.7, and I have the following script:

option batch abort
option confirm off
open ftps://<user>:<password>@<host> -implicit -certificate="<...>"
put "D:\Transfer\WinSCP\text.txt"
exit

The put commnd is currently failing due to a network configuration issue on our target server (our problem, definitely not WinSCP's), and when it fails, WinSCP prompts for: "(A)bort, (R)econnect". No matter what combination of "option batch" and "option confirm" I use, it will always Reconnect if no response is provided. If run without the console, via WinSCP.com, again it chooses Reconnect every time.

Is there a way to force it to Abort on error? If left alone, the script just continues to Reconnect, presumably forever. We want the command to Abort on error by default, instead of Reconnect.

Thank you,
Dan