@echo off
REM continous loop batch file. Use Ctrl+X to break out of.
:BEGIN
PING <server ip or FQDN> >NUL 2>&1
IF ERRORLEVEL 1 (
REM server is unreachable so run other batch file and return
call <batch job you want to run>
GOTO BEGIN
) ELSE (
REM delay for 5 seconds
PING 1.1.1.1 -n 10 -w 500 >NUL
GOTO BEGIN
)
|