Detect internet connectivity and reboot router as required

ByChris Hall

Detect internet connectivity and reboot router as required

If you’re having issues with your internet connection and finding your Router is dropping Internet at random times, the below windows batch may help alleviate the issue as a temporary measure.

To run this, download a copy of plink.exe from the putty download page and save it to a server running onsite (as an example to C:\admin\plink.exe). Copy the below into a batch file in the same directory and save the file. You can then use Task Scheduler to run the task automatically during the day.

The script pings and is the ping fails triggers a reboot on the router.

If needed you could setup this to email using VBS and/or log the reboots in a file by pipping the information out (you can do this by typing “ >> C:\admin\plink_log.txt” without the quotes at the end of the reboot command).

@echo off
ping -n 1
echo reboot|”C:\admin\plink.exe” -ssh -pw ******** admin@ reboot

About the author

Chris Hall administrator

Leave a Reply