Solved

Need to automate Telnet login & reboot of a router

Posted on 2010-11-21
2
1,016 Views
Last Modified: 2012-05-10
I need to automatically reboot a Netgear Prosafe router. The router accepts a Telnet login and the reboot command, so I can go to a command line and do telnet 192.168.x.x & the rouer prompts for username, which I enter, then password, ditto, then I can type reboot and hit enter and off it goes.

How to do that in a batch file or a VB script?

Thanks!
0
Comment
Question by:snooflehammer
2 Comments
 
LVL 4

Accepted Solution

by:
t509 earned 500 total points
ID: 34186672
Try this one and modify it to your needs, it worked for me without any problems on various cisco boxes where i couldn´t use KRON or EEM:

set wshbin = createobject("wscript.shell")
output = wshbin.run("telnet <YOUR ROUTERS IP ADDRESS>")
      wscript.sleep(1000)
      wshbin.Sendkeys "<YOUR USERNAME>~"
      wscript.sleep(200)
      wshbin.Sendkeys "<YOUR PASSWORD>~"
      wscript.sleep(200)
      wshbin.Sendkeys "reboot~"
      wscript.sleep(400)
wscript.quit

You´ll have to name the file with an .vbs extension.
0
 

Author Comment

by:snooflehammer
ID: 34193836
Sweeeeeeeeeeeeeeeeeet!

You're the man

Thank you VERY much.
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

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.
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…

863 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

25 Experts available now in Live!

Get 1:1 Help Now