outkrot.blogg.se

Putty batch script example
Putty batch script example










putty batch script example
  1. #PUTTY BATCH SCRIPT EXAMPLE SERIAL#
  2. #PUTTY BATCH SCRIPT EXAMPLE FULL#

This method does store the password in clear text, so you’ll want to be careful if you store the script on your desktop or somewhere easy to find, since anyone can then find out your password.

#PUTTY BATCH SCRIPT EXAMPLE FULL#

Tell it where to find PuTTY (use the full path, it’s easier) and connect to HOSTNAME using USERNAME with PASSWORD. WshShell.Run " PATH-TO-PuTTY HOSTNAME -l USERNAME -pw PASSWORD"įirst, you declare the object. set WshShell = WScript.CreateObject("WScript.Shell") Here’s the script I used, courtesy of Experts Exchange. Though I didn’t really want to use Windows Script, it worked really well for this purpose. If you want to run a whole set of them (or four, as the case may be), you’re out of luck. You see, you can use Plink (a PuTTY tool) to run commands, but only individual commands. For that, you need to add a Windows Script.

putty batch script example

The only problem is automating the process. This free client handles all sorts of SSH connections, and it just so happens that I can make one to my router. So I decided to see if I could come up with a way of automating the process. But it can get really annoying when you have to do it over and over (and over) again. At least until the next time the connection dies. This tells it to go out and grab a new DHCP address, which gets everything going again. See? Not hard – just enter configuration mode for the ethernet line, shut it down and restart. Like I said, it’s not hard, but it is tedious.

#PUTTY BATCH SCRIPT EXAMPLE SERIAL#

Either I have to load up a serial session or a telnet one, and then type four commands. This isn’t a difficult process, but it is a pain. So it means that I need to log into the router and shutdown the line and reset it anytime the line goes down – which over the last week and a half has been several times a day. Unfortunately, if the line goes down, it doesn’t do quite as good as job as recovering, which is odd, since it’s a lot more expensive. It provides a better connection – provided the line itself is working. And in case you’re wondering, it’s because I use a Cisco router at home, rather than the standard Linksys fare. Because of my recent communication issues with a cable telecommunications provider who just can’t seem to get things right, I’ve had to log into my router a number of times to reset the line.












Putty batch script example