標題:
多個vbs執行問題
[打印本頁]
作者:
herhsiu
時間:
2011-10-3 18:17
標題:
多個vbs執行問題
工作需要每天執行下面這些程式碼,總共有80個電腦需做這項工作,但是視窗好像無法開超過9個還是十個,所以後面的都不會執行,該如何修改才能夠讓程式完整跑完?
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "E:\11.vbs" & Chr(34), 0
Set WshShell = Nothing
set arg=WScript.Arguments
set sh=WScript.CreateObject("WScript.Shell")
sh.Run "cmd.exe /c start /realtime telnet 10.18.220.181"
WScript.Sleep 800
sh.AppActivate "Telnet 192.168.120.181"
WScript.Sleep 800
sh.SendKeys "act0{ENTER}"
WScript.Sleep 300
sh.SendKeys "/home/pack.sh"+"{ENTER}"
WScript.Sleep 350
sh.SendKeys "/home/modp.sh"+"{ENTER}"
WScript.Sleep 700
sh.SendKeys "/home/ack.sh"+"{ENTER}"
WScript.Sleep 350
sh.SendKeys "exit{ENTER} "
WScript.Sleep 300
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "E:\LIT EE2 module disk\LIT EE2 module disk\Backup\I12.vbs" & Chr(34), 0
Set WshShell = Nothing
set arg=WScript.Arguments
set sh=WScript.CreateObject("WScript.Shell")
sh.Run "cmd.exe /c start /realtime telnet 10.18.221.198"
WScript.Sleep 800
sh.AppActivate "Telnet 10.18.221.198"
WScript.Sleep 800
sh.SendKeys "act0{ENTER}"
WScript.Sleep 300
sh.SendKeys "/home/pack.sh"+"{ENTER}"
WScript.Sleep 350
sh.SendKeys "/home/modp.sh"+"{ENTER}"
WScript.Sleep 700
sh.SendKeys "/home/ack.sh"+"{ENTER}"
WScript.Sleep 350
sh.SendKeys "exit{ENTER} "
WScript.Sleep 300
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "E:\LIT EE2 module disk\LIT EE2 module disk\Backup\I13.vbs" & Chr(34), 0
作者:
herhsiu
時間:
2011-10-6 14:07
回復
1#
herhsiu
我自己來回答~:)
Dim ID(5)
ID(0) = "01.vbs"
ID(1) = "02.vbs"
ID(2) = "03.vbs"
ID(3) = "04.vbs"
ID(4) = "05.vbs"
Const ForReading = 1
no = 0
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile ("d:\IP.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strComputer = objTextFile.ReadLine
set arg=WScript.Arguments
set sh=WScript.CreateObject("WScript.Shell")
sh.Run "cmd.exe /c start /realtime telnet " & strComputer
WScript.Sleep 1500
sh.SendKeys "act{ENTER}"
WScript.Sleep 800
sh.SendKeys "act0{ENTER}"
WScript.Sleep 800
sh.SendKeys "/home/act/ec/utl/pack.sh"+"{ENTER}"
WScript.Sleep 500
sh.SendKeys "/home/act/ec/utl/modp.sh"+"{ENTER}"
WScript.Sleep 700
sh.SendKeys "/home/act/ec/utl/ack.sh"+"{ENTER}"
WScript.Sleep 500
sh.SendKeys "exit{ENTER} "
WScript.Sleep 360000
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & ID(no) & Chr(34), 0
Set WshShell = Nothing
no = no+1
WScript.Sleep 120000
Loop
objTextFile.Close
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)