Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reboot a router  through a script, batch or exe

Posted on 2008-10-11
3
Medium Priority
?
10,548 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
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…

688 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