Solved

Reboot a router  through a script, batch or exe

Posted on 2008-10-11
3
9,779 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

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…
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

773 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