Solved

Reboot a router  through a script, batch or exe

Posted on 2008-10-11
3
9,671 Views
Last Modified: 2012-06-21
I have a router Huawei EchoLife HG520s, and I need a script, exe or batch file to reboot it automatically, in order to use it with other program to get a new ip automatically each 45 minutes.

Using Telnet I do the following to reboot:

C:\> Telnet 192.168.1.1
Password: *********
HG520s> set reboot


If is possible to get code this in a very simple exe or batch would be perfect, or any other solution is also appreciated.

Thanks
0
Comment
Question by:dscholtes
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
James Murrell earned 500 total points
ID: 22694833
Ok here's the script and method to reboot it.

1) Scheduling:
For scheduling the reboot, download TST10 from winsite.com downloads. It is a tiny freeware Telnet utility with support for scripting. Extract the utility to a folder on your hard drive. e.g. C:\TST. In this folder, create a new text file. This is the file in which we will write the script for TST10, so name it anything you like e.g. reboot.txt. Edit this file in notepad and paste the following. Remember to include the quotes as well and exclude the line which says script.

2) Script :

192.168.1.23
WAIT "Login"
SEND "admin\m" (enter your login ID here)
WAIT "Password"
SEND "admin\m" (enter your password here)
WAIT "->"
SEND "12\m"
WAIT "==>"
SEND "1\m"
WAIT "The system shell is being reset. Please wait..."

192.168.1.1 is the address you use to access the router configuration. 23 is the port to which telnet connects. Replace "login_id" and "password" with the login and password respectively, that you use to access the router configuration page from a browser. Remember, keep the \m after the id and pass.

Now simply create a scheduled task using the inbuilt Windows task scheduler.

Important: Create a task to run tst10.exe with the command line parameter /r:reboot.txt.



taken from http://broadbandforum.in/airtel-broadband/13107-fastest-way-reboot-router/2/ 
0
 

Author Comment

by:dscholtes
ID: 22709396
Thank you very much cs97jjm3,

It worked after i made some simple changes in the script according to my router,  reading the article in the website of your source.

my script is:

192.168.1.1 23
WAIT "Password"
SEND "notan37facil\m"
WAIT "HG520s>"
SEND "set reboot\m"
WAIT "The system shell is being reset. Please wait..."


0
 

Author Closing Comment

by:dscholtes
ID: 31505281
thank you for your help.
muchas gracias.

sorry if i wrote bad english.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now