比如,我用VBS判断RAR.EXE压缩程序是否已结束,如果没有结束,则过2秒后继续判断,直到结束为止,以继续执行后面的代码。用VBS应该如何写呢?
第1个回答 2011-08-05
Set WMI=GetObject("WinMgmts:")
Dim isrun
Do
isrun=0
Set procs=WMI.InstancesOf("Win32_Process")
For Each p In procs
If "rar.exe"=p.name Then isrun=1
Next
Set procs=Nothing
If 1=isrun Then WScript.Sleep 2*1000
While (1=isrun)本回答被提问者采纳
Dim isrun
Do
isrun=0
Set procs=WMI.InstancesOf("Win32_Process")
For Each p In procs
If "rar.exe"=p.name Then isrun=1
Next
Set procs=Nothing
If 1=isrun Then WScript.Sleep 2*1000
While (1=isrun)本回答被提问者采纳