@ECHO OFF
COLOR 1F
TITLE GATEWAY PING TEST
:PINGTEST
CLS
FOR /F "TOKENS=2 DELIMS=:" %%G IN ('IPCONFIG ^| find "Default Gateway"') DO (
IF NOT "%%G"==" " (
PING -w 30000 -n 1 %%G
IF ERRORLEVEL 1 ECHO UNABLE TO PING GATEWAY!!!
)
)
ECHO.
CHOICE /T 5 /D Y /M "WAITING 5 SECONDS BEFORE RETRY"
GOTO PINGTEST
*This has only been tested with Windows 7. YMMV