| |
schnizzlewizz
Posts: 1
Score: 0
Joined: 2/11/2005
From:
Status: offline
|
I am new to writing vbs scripts and I need some help. The objective of this script is to backup a config of a device to a stationary pc. The way the script is written it works fine but It doesn't know whether a device is working or not. What I would like to do is insert some script that will ping each device first and whether you get a reply from the ping or not, have the script either continue on or skip the portion of the script that the ping failed down to the beginning of the next node. Here is a sample: set WshShell = WScript.CreateObject("WScript.Shell") Wshshell.run "cmd.exe" 'NOTE x.x.x.xxx WScript.sleep 1000 Wshshell.sendkeys "telnet x.x.x.xxx" WScript.sleep 2500 Wshshell.sendkeys "~" WScript.sleep 2500 Wshshell.Sendkeys "admin" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.Sendkeys "pr" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.sendkeys "copy run start" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 5000 Wshshell.sendkeys "copy start ftp x.x.x.xxx a aaaaaa x.xxx__backup.bin" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 1000 Wshshell.sendkeys "exit" WScript.sleep 1000 Wshshell.sendkeys "~" 'NOTE x.x.x.xxx WScript.sleep 1000 Wshshell.sendkeys "telnet x.x.x.xxx" WScript.sleep 2500 Wshshell.sendkeys "~" WScript.sleep 2500 Wshshell.Sendkeys "admin" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.Sendkeys "pr" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 500 Wshshell.sendkeys "copy run start" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 5000 Wshshell.sendkeys "copy start ftp x.x.x.xxx a aaaaaa x.xxx__backup.bin" WScript.sleep 500 Wshshell.sendkeys "~" WScript.sleep 1000 Wshshell.sendkeys "exit" WScript.sleep 1000 Wshshell.sendkeys "~"
|
|