November 5, 2024

Rebooting home router daily or at regularly intervals need not be a manually repetitive task. It can be automated so that it can reboot as per desired schedule without intervention.

To do this in Windows, there are 3 main steps :

  • Installing a Telnet client
  • Making a router reboot script
  • Linking the reboot script using Windows Task Scheduler

(The script used here is tested using Windows 10 and D-Link router. The parameters for reboot schedule used are : daily at 7:05 pm).

Installing a Telnet client : This isn’t installed by default in Windows. To install it, go to Programs and Features and click on Turn Windows Features On or Off.

turning on or off windows features

Next, drill down to Telnet Client, select it and click OK. Wait for the installation to complete.

installing telnet client in Windows

Now that Telnet client is enabled, a router reboot script is needed.

Router reboot script :

Copy paste the below .vbs code in notepad, replace the router IP address, login username and password. Save this as a .vbs extension and as All Files.

saving the router reboot script as vbs file

set WshShell = WScript.CreateObject("WScript.Shell")

'Open a Telnet connection to router IP'
'Delay of 4 seconds in between using the Sleep 4000 parameter when entering commands'

WshShell.run"telnet.exe 192.168.1.1"
WScript.Sleep 4000

'Provide username
WshShell.SendKeys"username"
WshShell.SendKeys("{Enter}")
WScript.Sleep 4000

'Provide user password
WshShell.SendKeys"password"
WshShell.SendKeys("{Enter}")
WScript.Sleep 4000

'Reboot the router
WshShell.SendKeys"reboot"
WshShell.SendKeys("{Enter}")

Before linking this script to Task Scheduler, it’s best to check if it does what is required.

Simply double click on it.

saved router reboot script

This will automatically open the Telnet window, connect to the router IP address with user credentials supplied and will reboot the router.

telnet window on router connection using script

Adding the script to Windows Task Scheduler : Once it is working as needed, open Windows Task Scheduler. (Shortcut for this would be to open the Run box using Windows key + R and typing taskschd.msc).

launching Windows task scheduler

Here, select Action > Create Basic Task.

Set a description as needed.

setting task description in task scheduler

Choose a schedule for rebooting the router. Here it is configured to reboot daily at 19:05 hours.

choosing task schedule in task scheduler

choosing start date and time for basic task in windows task scheduler

Select the program to be launched for this created task. This will be the reboot script created before.

starting a program as task in windows

adding the router reboot script as task in Windows task scheduler

Finally, click Finish. The auto reboot task is created and the router script will be triggered automatically as per the set schedule.

created task that auto reboots router in windows

All done.

By the way, there are some great deals on home routers at Amazon here.

Viva la automation! 🙂

By admin

Related Post

5 thoughts on “Automatically Reboot Home Router When Using Windows”
  1. Does not reboot the Netgear R8000 on a Windows 10 platform. Telnet window opens then runs through the commands with no apparent errors then closes but router does not reboot.

    I need to get something automated to work as every day the ports assigned for my security dvr close and will not open unless the router is rebooted.

  2. Great tutorial, thank you very much. I used it in my router which is a VDSL router (model Sagemcom 103), from STC in Saudi Arabia. The script works just fine, and I’m scheduling a daily reboot as I have a problem of loosing my telephone line every day, and I need to restart the router to get the line back.

Comments are closed.