This tool is used for keeping your computer/server is connected to the Internet and runs a batch file when the tool detects that the status has changed. The status is a number that is reached by the %1 variable in the batch file. The batch file is the exe filename but instead of ending .exe its .bat This tool was made for detecting my server ports being offline
Here’s the Batch file code list:
-1 The Internet is working
0 The port is closed but Internet is available
1 The port is open and reachable
2 No Internet
NOTE SEE HELP BEFORE USING, YOU CAN TYPE PINGER.EXE /?
TO READ HELP INFORMATION.
For my Server I put the following lines in the pinger.bat file:
@echo off if "%1"=="0" goto connect if "%1"=="-1" goto connect exit /b 0 :connect rasdial MyVPN username password exit /b %errorlevel%
This reconnects the VPN after it disconnects or if the server over the internet finds the specified port closed. If the exitcode is nonzero it will retry.