Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1073
  • Last Modified:

Need to automate Telnet login & reboot of a router

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
snooflehammer
Asked:
snooflehammer
1 Solution
 
t509Commented:
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
 
snooflehammerAuthor Commented:
Sweeeeeeeeeeeeeeeeeet!

You're the man

Thank you VERY much.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now