If I create a collection of running processes and I want to check that a process is no longer running, how do I make that check. Below is the collection but I can't figure out how to tack on a condition if the objprocess in the colprocess is no longer running
Basically I want to do a loop until it finds that the process I specified is no longer running
Code:
strProcess = nameofprocess
Do
Set objWMIServices = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcess = objWMIServices.ExecQuery _
("Select * from Win32_Process Where Name = " & strProcess )
For Each objProcess in colProcess
....
....
....
Loop Until(condition that I cant figure out)
Basically I want to do a loop until it finds that the process I specified is no longer running