Question : what is the easy way of hitting a remote server on its availability every 5 secs and start up a batch file when it comes down

what is the easy way of hitting a remote server on its availability every 5 secs and start up a batch file when it comes down in windows.

Answer : what is the easy way of hitting a remote server on its availability every 5 secs and start up a batch file when it comes down

I think this might do what you want. Replace the information between the <>'s with proper information.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
@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
)
Random Solutions  
 
programming4us programming4us