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?

Who is Participating?
t509Connect With a Mentor Commented:
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("")
output ="telnet <YOUR ROUTERS IP ADDRESS>")
      wshbin.Sendkeys "<YOUR USERNAME>~"
      wshbin.Sendkeys "<YOUR PASSWORD>~"
      wshbin.Sendkeys "reboot~"

You´ll have to name the file with an .vbs extension.
snooflehammerAuthor Commented:

You're the man

Thank you VERY much.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.