Post a reply

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)


Topic review


Re: if statement for "Connection refused"

There's no simple solution. But you can use XML logging. If it contains just empty <session/> tag (like below) and exit code is 1, it is likely that the connection has failed for some reason.

<?xml version="1.0" encoding="UTF-8"?>

<session xmlns="" name="my session" start="2011-02-02T07:17:47.632Z">


I want to detect if the IP has changed, because i use a access list. Thats what i'm trying to filter out with an errorlevel, to send mail. But errorlevel 1 seems to wide.

please help!

if statement for "Connection refused"

Hello, i want to sent an error e-mail only when connection is refused. How do i catch this, is there a error level or code to catch it?

If a file fails transferring, i don't want to send an e-mail.

It seems errorcode 1 is wider then what i want.


echo nietwinxp /script=buo-nietwinxp.txt
if errorlevel 1 goto error
goto end

log of connection refused:
. 2011-01-31 14:43:51.468 Looking up host ""

. 2011-01-31 14:43:51.473 Connecting to port 22
. 2011-01-31 14:43:53.581 Server unexpectedly closed network connection
* 2011-01-31 14:43:53.585 (ESshFatal) Server verbrak onverwacht de netwerkverbinding.