1、上面的代码里并没有加入运行程序的代码。
2、vbs 里编写循环运行的程序不好,因为没有提供额外的控制程序中止的机制。
以下是加入运行程序的代码,仅供参考:Set obj=createobject("wscript.shell")
Set rd=getobject("winmgmts:\\.")
Set dl=rd.instancesof("win32_process")
a1 = appIsNotExits("001.exe")
a2 = appIsNotExits("002.exe")
a3 = appIsNotExits("003.exe")
a4 = appIsNotExits("004.exe")
a5 = appIsNotExits("005.exe")
If a1 And a2 And a3 And a4 And a5 Then
runExes()
Next
Function runExes()
obj.run "001.exe"
obj.run "002.exe"
obj.run "003.exe"
obj.run "004.exe"
obj.run "005.exe"
runExes = True
End Function
Function appIsNotExits(sAppName)
Result = True
For each r in dl
If r.name= sAppName Then
Result = False
Exit For
End if
Next
appIsExits = Result
End Function