Set WshShell = CreateObject("WScript.Shell")
Dim CloseTime,i
CloseTime = 3
For i = CloseTime To 1 Step - 1
WshShell.popup "当前时间为" & i,1,"计时",0
Wscript.Sleep 1000
next
'上段命令,开启后倒计时,时间为closetime的值。默认为零,不弹出倒计时窗口。'
dim ta,shell,j,showtime
showtime =1
'定义变量,赋值。 j,showtime,变量用于下面的提示框弹出函数。
set shell=wscript.createobject("wscript.shell")
shell.appactivate"115200"
shell.SendKeys "setenv serverip 192.168.1.224"
WScript.Sleep 400
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 600
shell.appactivate"115200"
shell.SendKeys "setenv ipaddr 192.168.1.225"
WScript.Sleep 500
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 600
shell.appactivate"115200"
shell.SendKeys "save"
WScript.Sleep 200
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 200
shell.appactivate"115200"
shell.SendKeys"protect off all"
WScript.Sleep 300
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 4600
shell.appactivate"115200"
shell.SendKeys"erase all"
WScript.Sleep 200
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 10000
shell.appactivate"115200"
MSGBOX("请务必在擦除完成后再点击确定")
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 200
WScript.Sleep 500
shell.appactivate"115200"
shell.SendKeys "tftp 0x80000000 6004-sz.bin"
WScript.Sleep 100
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 5000
shell.appactivate"115200"
MSGBOX("请务必在写完后再点击确定")
WScript.Sleep 200
shell.appactivate"115200"
shell.SendKeys "re"
WScript.Sleep 200
shell.appactivate"115200"
shell.SendKeys "{ENTER}"
WScript.Sleep 1000
这是我现在使用的VBS文件,请高手帮忙处理下,非常感谢!