>>19
こんなもんでヒントになるかな。

@echo off
set PING=NG
for /F %%i in ('ping 127.0.0.1') do if %%i==Reply set PING=OK
echo %PING%