is there a way to read the used memory from a process I get via
oWmi.ExecQuery ("select ... from Win32_process ...")?
I would like to read the figures as shown under memory usage in the
process list of the task manager.
Best regards,
Michael
Lee
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer &
"\root\cimv2")
Set colProcessList = objWMIService.ExecQuery _
("SELECT * FROM Win32_Process")
For Each objProcess in colProcessList
Wscript.Echo "Process: " & objProcess.Name
Wscript.Echo "Process ID: " & objProcess.ProcessID
Wscript.Echo "Thread Count: " & objProcess.ThreadCount
Wscript.Echo "Page File Size: " & objProcess.PageFileUsage
Wscript.Echo "Page Faults: " & objProcess.PageFaults
Wscript.Echo "Working Set Size: " & objProcess.WorkingSetSize
Next
WorkingSetSize looks good. If I devide it by 1024 I get the same number
as show in task manager.
Thanks a lot,
Michael