strComputer = "."
Set wbemServices = Getobject("winmgmts:\\" & strComputer)
Set wbemObjectSet = wbemServices.InstancesOf("Win32_Process")
For Each wbemObject In wbemObjectSet
WScript.Echo "Name: " & wbemObject.Name & vbCrLf & _
" Handle: " & wbemObject.Handle & vbCrLf & _
" Process ID: " & wbemObject.ProcessID
Next