I am happy to say that I am able to automate reboot script with Netgear DG834Gv3 WiFi-ADSL2+ Router.
I always had to manually recycle the power for this device in order to reboot as:
a. The Telnet server is not enabled on the DG834Gv3 by default router. It can only be enabled using a debug script and even then it will only last till the next reboot after which the Telner Service gets disabled again. Also you have to open a browser to do this.
b. It doesnt work well with the telnet scripting application TST10.EXE (atleast I couldnt figure out a way till now)
My Method:
1. Download CURL (cURL - Download - 7.19.2 - 1.18mb) and extract it a folder (ex: C:\MTNL)
**CURL is used to enable TELNET service by passing the router credentials along with the debugging URL in the form of:
curl.exe --basic --user username
assword --url "http://192.168.1.1/setup.cgi?todo=debug"
2. Create a file called NETGEAR.TXT and put it in the same folder as CURL. This file should contain the IP Address of your Netgear device (ex: 192.168.1.1) and nothing else.
3. Create a file called NETGEAR.VBS using Notepad and put the following code in it:
'----BEGINNING-OF-SCRIPT-----
'Created for MAC filtering maintenance
'opens a TELNET session to all AP's
On Error Resume Next
strComputer = "."
filespec="C:\MTNL\netgear.txt" 'data file with IP addresses
Dim objFSO, a, s, WshShell, Windir, i, objWMIService
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
s = objFS
pentextfile(filespec,1,true).ReadAll
a = Split(s,vbCrLf)
Set WshShell = CreateObject("WScript.Shell")
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
For i=0 to UBound(a)
If Trim(a(i))<>"" Then
'Launch telnet session from the command line
WshShell.Run "telnet " & a(i)
'Wait until the application has loaded
WScript.Sleep 300
Set ColProcesses = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each Process in ColProcesses
If Process.Name = "Telnet " & a(i) Then
WshShell.AppActivate Process.Name
End If
Next
wscript.sleep 200
WshShell.SendKeys "{ENTER}"
wscript.sleep 200
WshShell.SendKeys "reboot"
wscript.sleep 200
WshShell.SendKeys "{ENTER}"
wscript.sleep 200
End If
Next
'----END-OF-SCRIPT-----
4. Create a batchfile using notepad called REBOOT.BAT with the code given below and put it in C:\MTNL.
cd C:\MTNL\
C:\MTNL\curl.exe --basic --user username
ass --url "http://192.168.1.1/setup.cgi?todo=debug"
cd C:\MTNL
C:\MTNL\curl.exe --basic --user username
ass --url "http://192.168.1.1/setup.cgi?todo=debug"
cd C:\MTNL
netgear.vbs
5. Use Windows Task Scheduler to run REBOOT.BAT at 12:10 am as well as 7:50 am.
Please do let me know if there is a simpler method.
Technically the above method should (with or without the CURL part) work with just about any router as long as it can be accessed using TELNET.
I always had to manually recycle the power for this device in order to reboot as:
a. The Telnet server is not enabled on the DG834Gv3 by default router. It can only be enabled using a debug script and even then it will only last till the next reboot after which the Telner Service gets disabled again. Also you have to open a browser to do this.
b. It doesnt work well with the telnet scripting application TST10.EXE (atleast I couldnt figure out a way till now)
My Method:
1. Download CURL (cURL - Download - 7.19.2 - 1.18mb) and extract it a folder (ex: C:\MTNL)
**CURL is used to enable TELNET service by passing the router credentials along with the debugging URL in the form of:
curl.exe --basic --user username

2. Create a file called NETGEAR.TXT and put it in the same folder as CURL. This file should contain the IP Address of your Netgear device (ex: 192.168.1.1) and nothing else.
3. Create a file called NETGEAR.VBS using Notepad and put the following code in it:
'----BEGINNING-OF-SCRIPT-----
'Created for MAC filtering maintenance
'opens a TELNET session to all AP's
On Error Resume Next
strComputer = "."
filespec="C:\MTNL\netgear.txt" 'data file with IP addresses
Dim objFSO, a, s, WshShell, Windir, i, objWMIService
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
s = objFS

a = Split(s,vbCrLf)
Set WshShell = CreateObject("WScript.Shell")
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
For i=0 to UBound(a)
If Trim(a(i))<>"" Then
'Launch telnet session from the command line
WshShell.Run "telnet " & a(i)
'Wait until the application has loaded
WScript.Sleep 300
Set ColProcesses = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each Process in ColProcesses
If Process.Name = "Telnet " & a(i) Then
WshShell.AppActivate Process.Name
End If
Next
wscript.sleep 200
WshShell.SendKeys "{ENTER}"
wscript.sleep 200
WshShell.SendKeys "reboot"
wscript.sleep 200
WshShell.SendKeys "{ENTER}"
wscript.sleep 200
End If
Next
'----END-OF-SCRIPT-----
4. Create a batchfile using notepad called REBOOT.BAT with the code given below and put it in C:\MTNL.
cd C:\MTNL\
C:\MTNL\curl.exe --basic --user username

cd C:\MTNL
C:\MTNL\curl.exe --basic --user username

cd C:\MTNL
netgear.vbs
5. Use Windows Task Scheduler to run REBOOT.BAT at 12:10 am as well as 7:50 am.
Please do let me know if there is a simpler method.
Technically the above method should (with or without the CURL part) work with just about any router as long as it can be accessed using TELNET.