Topic "ERRORLEVEL is 0 on Network error"

Author Message
chart
[View user's profile]

Joined: 2012-11-20
Posts: 1
Location: US
i'm using the WINSCP.EXE to download files and i'm not seeing an ERRORLEVEL 1 if there is a network error.

in my BAT file:

Code:
"C:\Program Files\WinSCP\winscp.exe" /script=%ScriptPath% /log=%LogFilePath%
IF ERRORLEVEL 1 goto error

:error
@Echo Send Error Email as a warning to the operations team
Goto End


in the script file:
Code:
option batch abort
option confirm off
open user:password@non-existentServerIP -hostkey="ssh-rsa...."
...
close
exit


in the log file:
Code:
. 2012-11-20 14:18:01.196 --------------------------------------------------------------------------
. 2012-11-20 14:18:01.196 WinSCP Version 4.2.9 (Build 938) (OS 5.2.3790 Service Pack 2)
. 2012-11-20 14:18:01.196 Login time: Tuesday, November 20, 2012 2:18:01 PM
. 2012-11-20 14:18:01.196 --------------------------------------------------------------------------
. 2012-11-20 14:18:01.196 Session name: session name removed
. 2012-11-20 14:18:01.196 Host name: ###.###.###.### (Port: 22)
. 2012-11-20 14:18:01.196 User name: username (Password: Yes, Key file: No)
. 2012-11-20 14:18:01.196 Tunnel: No
. 2012-11-20 14:18:01.196 Transfer Protocol: SFTP (SCP)
. 2012-11-20 14:18:01.196 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2012-11-20 14:18:01.196 Proxy: none
. 2012-11-20 14:18:01.196 SSH protocol version: 2; Compression: No
. 2012-11-20 14:18:01.196 Bypass authentication: No
. 2012-11-20 14:18:01.196 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2012-11-20 14:18:01.196 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2012-11-20 14:18:01.196 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2012-11-20 14:18:01.196 SFTP Bugs: -,-
. 2012-11-20 14:18:01.196 Return code variable: Autodetect; Lookup user groups: Yes
. 2012-11-20 14:18:01.196 Shell: default
. 2012-11-20 14:18:01.196 EOL: 0, UTF: 2
. 2012-11-20 14:18:01.196 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2012-11-20 14:18:01.196 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2012-11-20 14:18:01.196 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2012-11-20 14:18:01.196 Cache directory changes: Yes, Permanent: Yes
. 2012-11-20 14:18:01.196 DST mode: 1
. 2012-11-20 14:18:01.196 --------------------------------------------------------------------------
. 2012-11-20 14:18:01.196 Looking up host "###.###.###.###"
. 2012-11-20 14:18:01.196 Connecting to ###.###.###.### port 22
. 2012-11-20 14:18:10.055 Failed to connect to ###.###.###.###: Network error: Connection timed out
. 2012-11-20 14:18:12.618 Failed to connect to ###.###.###.###: Network error: Connection refused


any ideas on how to capture this error? thanks.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please upgrade and attach a complete log file using the latest version.
_________________
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