| |
macer
Posts: 1
Score: 0
Joined: 5/27/2005
From:
Status: offline
|
Hello I am trying to determine the number of instances running on a computer of a particular application. Below is the code I'm using to determine the number of Excel instances, but it returns an error when I attempt to get the number of items in the collection. Any suggestions? Thanks Macer Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") strQuery = "Select * from Win32_Process where Name='excel.exe'" Set colItems = objWMIService.ExecQuery(strQuery,,48) iNum = colItems.count WScript.Echo iNum One solution would be to count each instance in the collection, but I was wanting to know how to get the count property to work. For Each objItem in colItems iNum = iNum + 1 Next WScript.Echo iNum
|
|