Solved

Need to automate Telnet login & reboot of a router

Posted on 2010-11-21
2
1,039 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
[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 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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

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.
How to set-up an On Demand, IPSec, Site to SIte, VPN from a Draytek Vigor Router to a Cyberoam UTM Appliance. A concise guide to the settings required on both devices
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…
Suggested Courses

719 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