Get all running processing on the local machine:
Dim objWMIService, objProcess, colProcess
Dim strComputer, strList
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2″)
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess in colProcess
strList = strList & vbCrLf & _
objProcess.Name
Next
Print strList
Posted in Scripting Techniques

Yaron Assa




April 11th, 2008 at 8:36 am
Why not use the Dotnetfactory with Process Class and use GetProcesses().
this will return Process[] and you can use all the processes properies…
April 11th, 2008 at 9:14 am
You’re absolutely right, it was going to be our next QTip. If you’d like, you can write it yourself, and we’ll publish it under your name!
Just send it to qtips@advancedqtp.com
June 12th, 2008 at 9:54 pm
Has anyone actually done this with DotNetfactory? I would like to do this but am having issue with:
DotNetFactory.CreateInstance(”System.Diagnostics”)
and just about any variation of said line of code that I can think of.
Or am I way off here?
Thanks
Mike