Thursday, November 4, 2010

Unattended access to Netscreen devices from vb script


I've found this post at experts-exchange: http://www.experts-exchange.com/Software/Internet_Email/File_Sharing/SSH_Telnet/Q_22920318.html

Here is a VBScript that should do what you are looking for. Just remember your credentials are in plain text in the script, set your permissions accordiningly:

set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run "C:\putty HOSTNAME -l LOGIN -pw PASSWORD"      ' put putty in C:\
WScript.Sleep 2000
WshShell.AppActivate "HOSTNAME - PuTTY"      'insert correct hostname
WshShell.SendKeys "command"             'insert dns refresh command
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
WScript.Sleep 1000
WshShell.SendKeys "exit"
WScript.Sleep 100
WshShell.SendKeys "{ENTER}"
You will need to put putty in you C:\ directory or give it an absolute path

Good Luck

Darkstriker69

No comments:

Post a Comment