its true that PING doesn't produce any ERRORLEVEL envvar, instead using its stdout output to examine that the remote machine is responding. The code would like this: ====== ping /n 1 xxx.yyy.zzz.nnn | find "TTL" > nul if %ERRORLEVEL% 1 echo Disconnected ======
по материалам http://www.computing.net/answers/windows-2000/errorlevel-not-produced-by-ping/61261.html