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

x
?
Solved

Need to automate Telnet login & reboot of a router

Posted on 2010-11-21
2
Medium Priority
?
1,062 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 2000 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

ATEN's HDBaseT Presentation at InfoComm 2017

Hear ATEN Product Manager YT Liang review HDBaseT technology, highlighting ATEN’s latest solutions as they relate to real-world applications during her presentation at the HDBaseT booth at InfoComm 2017.

Question has a verified solution.

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

It happens many times that access list (ACL) have to be applied to outgoing router interface in order to limit some traffic.This article is about how to test ACL from the router which is not very intuitive for everyone. Below scenario shows simple s…
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.
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…

715 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