Solved

Reboot a router  through a script, batch or exe

Posted on 2008-10-11
3
10,058 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VPN Server config in Modem 5 90
SSH setup on ASA 5505 17 122
Tracert fails final hop at some client offices 3 47
batch file - date difference calculation 5 29
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
In the world of WAN, QoS is a pretty important topic for most, if not all, networks. Some WAN technologies have QoS mechanisms built in, but others, such as some L2 WAN's, don't have QoS control in the provider cloud.
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…

734 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