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

DaveR

Re: No Error Code if SFTP fails to Connect in Script

Hi Martin,

After a closer look at my script, I found that I had two syntax errors on the one line so the script worked if there was a successful connection.
After making the corrections, I changed the desitnation IP address to produce a connection timeout. WinSCP now produces the correct errorlevel 1 on a failed connection.

Sorry to have bugged you.

Regards,

Dave
DaveR

Re: No Error Code if SFTP fails to Connect in Script

Hi Martin,
Apologies for the delay in replying.
I have attached the log file showing a fail to connect and a successful session.
Have also included a copy of the script file.
Thanking you in advance.

Dave
martin

Re: No Error Code if SFTP fails to Connect in Script

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

To generate the session 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.
DaveR

No Error Code if SFTP fails to Connect in Script

Hi, I have a simple .cmd script that performs a check for presence of Files and if present calls winscp.com commandline with switches etc..
I have used the if %ERRORLEVEL% neq 0 goto error if a successful connection is used to then trigger a move of files after upload.
However, I had a situation where the SFTP client failed to connect to remote server. The logs showed an error level of 0 upon exit for failing to connect, which then triggered the move function.
Is this expected for a failed connection?

Please advise.
Thanks,
Dave