code:

$machine = "sh1262"
shell '%comspec% /c ping $machine -n 1 -w 20|find /c "'+'TTL=" 2>&1 >NUL'
? "existing machine returns: @error" ?
$machine = "sh01262"
shell '%comspec% /c ping $machine -n 1 -w 20|find /c "'+'TTL=" 2>&1 >NUL'
? "non existent machine returns: @error" ?
get $


existing machine gives you 0 and others 1

I don't think you should use batch file. why should you? do your code as:

code:

shell '%comspec% /c ping $machine -n 1 -w 200|find /c "'+'TTL=" 2>&1 >NUL'
if @error
shell 'mapisend -u test -p s -r pete.fry -s "ping'+' failed"'
endif


and you don't need to call any file.
this method is so much faster that I sincerely recommend it
_________________________
!

download KiXnet