png.bat

@echo off
rem default target (e.g. your home server)
set TARGET="192.168.0.123"
set DELAY=15
set TARGET1="www.myspeedmeter.net"
set TARGET2="www.dslreports.com"
if "%1"=="" goto loop
set TARGET=%1
set DELAY=5

:loop
rem echo %TARGET%
rem ping -n 1 %TARGET% | head -3 | tail -1
ping -n 1 %TARGET% | Findstr /I /C:"timed out" /C:"host unreachable"
if %ERRORLEVEL%==1 goto ok
REM echo "failed"
rundll32 user32.dll,MessageBeep -1
goto cnt
:ok
ping -n 1 %TARGET% | head -3 | tail -1
:cnt
if NOT "%1"=="" goto loop2
echo %TARGET1%
ping -n 1 %TARGET1% | head -3 | tail -1
echo %TARGET2%
ping -n 1 %TARGET2% | head -3 | tail -1
:loop2
choice /d Y /t %DELAY%  /m "CONTINUE"
if errorlevel 2 goto exit
goto loop
:exit

Comments