Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WMI + ExecutionState

Status
Not open for further replies.

sfriday

IS-IT--Management
Feb 23, 2002
211
DE
All,

I am trying to obtain the status of all processes on a win2k workstation,

I have the following code

dim state
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess in colProcessList
colProperties = objprocess.name
state = objprocess.ExecutionState
msgbox colproperties & " " & state
Next

However it always returns null - I am expecting 1-6 am I missing the point

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top