My idea is that there is some other failure.
I did it like this:

code:

%comspec% /c ping pikvalexchange -n 1 -w 20|find /c "(0% loss)"
echo "%errorlevel%"
%comspec% /c ping pikvalexchange -n 1 -w 20|find /c "(0%% loss)"
echo "%errorlevel%"


pikvalexchange = e-mail server
and the result was:
code:

C:\kix2k1\rc1>test.bat

C:\kix2k1\rc1>C:\WINNT\system32\cmd.exe /c ping pikvalexchange -n 1 -w 20 | find /c
0

C:\kix2k1\rc1>echo "1"
"1"

C:\kix2k1\rc1>C:\WINNT\system32\cmd.exe /c ping pikvalexchange -n 1 -w 20 | find /c
1

C:\kix2k1\rc1>echo "0"
"0"


so it worked.
take the "-w 20" of and test again. it means that ping does not wait the reply longer than 20ms before quitting with error.
if you have slower net you might try to take it of or set to some 100ms.

cheers,

_________________________
!

download KiXnet