'Retrieve all process information currently on a system using Windows Script
'Source : MSDN
'02/06/2006
*************************************************************************
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process where ProcessId = 0",,48)
For Each objItem in colItems
Wscript.Echo "Caption: " & objItem.Caption
Wscript.Echo "CSName: " & objItem.CSName
Wscript.Echo "ExecutablePath: " & objItem.ExecutablePath
Wscript.Echo "Handle: " & objItem.Handle
Wscript.Echo "HandleCount: " & objItem.HandleCount
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "OSCreationClassName: " & objItem.OSCreationClassName
Wscript.Echo "OSName: " & objItem.OSName
Wscript.Echo "PageFaults: " & objItem.PageFaults
Wscript.Echo "PageFileUsage: " & objItem.PageFileUsage
Wscript.Echo "PeakPageFileUsage: " & objItem.PeakPageFileUsage
Wscript.Echo "PeakVirtualSize: " & objItem.PeakVirtualSize
Wscript.Echo "PeakWorkingSetSize: " & objItem.PeakWorkingSetSize
Wscript.Echo "Priority: " & objItem.Priority
Wscript.Echo "PrivatePageCount: " & objItem.PrivatePageCount
Wscript.Echo "ProcessId: " & objItem.ProcessId
Wscript.Echo "QuotaNonPagedPoolUsage: " & objItem.QuotaNonPagedPoolUsage
Wscript.Echo "QuotaPagedPoolUsage: " & objItem.QuotaPagedPoolUsage
Wscript.Echo "QuotaPeakNonPagedPoolUsage: " & objItem.QuotaPeakNonPagedPoolUsage
Wscript.Echo "QuotaPeakPagedPoolUsage: " & objItem.QuotaPeakPagedPoolUsage
Wscript.Echo "SessionId: " & objItem.SessionId
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "ThreadCount: " & objItem.ThreadCount
Wscript.Echo "UserModeTime: " & objItem.UserModeTime
Wscript.Echo "VirtualSize: " & objItem.VirtualSize
Wscript.Echo "WorkingSetSize: " & objItem.WorkingSetSize
Wscript.Echo "WriteOperationCount: " & objItem.WriteOperationCount
Next
*************************************************************************
No comments:
Post a Comment