MAIN CODE
On Error Resume Next
strComputer = "."
' ---CREATE OBJECTS----
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
'---GET TITLES OF ALL PROCESS AND DISPLAY---
Titles=""
For Each objItem in colItems
Titles = Title1 & UCASE(objItem.Caption) & " , "
Next
msg = vbtab & "Process List" & vbcrlf & "-----------------------------------" & vbcrlf & Titles
msgbox msg
msg =""
'--- DISPLAY PROCESS DETAILS 1 BY 1 ----
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each objItem in colItems
msg = "Process : " & UCASE(objItem.Caption)
msg = msg & vbcrlf & "--------------------------------------------------------------"
msg = msg & vbcrlf & "CommandLine: " & objItem.CommandLine
msg = msg & vbcrlf & "CreationClassName: " & objItem.CreationClassName
msg = msg & vbcrlf & "CreationDate: " & objItem.CreationDate
msg = msg & vbcrlf & "CSCreationClassName: " & objItem.CSCreationClassName
msg = msg & vbcrlf & "CSName: " & objItem.CSName
msg = msg & vbcrlf & "Description: " & objItem.Description
msg = msg & vbcrlf & "ExecutablePath: " & objItem.ExecutablePath
msg = msg & vbcrlf & "ExecutionState: " & objItem.ExecutionState
msg = msg & vbcrlf & "Handle: " & objItem.Handle
msg = msg & vbcrlf & "HandleCount: " & objItem.HandleCount
msg = msg & vbcrlf & "InstallDate: " & objItem.InstallDate
msg = msg & vbcrlf & "KernelModeTime: " & objItem.KernelModeTime
msg = msg & vbcrlf & "MaximumWorkingSetSize: " & objItem.MaximumWorkingSetSize
msg = msg & vbcrlf & "MinimumWorkingSetSize: " & objItem.MinimumWorkingSetSize
a= msgbox(msg & vbcrlf & vbcrlf & vbtab & "......continue with next process....?",vbYESNO)
if a= VBNO then
Exit For
End IF
Next
strComputer = "."
' ---CREATE OBJECTS----
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
'---GET TITLES OF ALL PROCESS AND DISPLAY---
Titles=""
For Each objItem in colItems
Titles = Title1 & UCASE(objItem.Caption) & " , "
Next
msg = vbtab & "Process List" & vbcrlf & "-----------------------------------" & vbcrlf & Titles
msgbox msg
msg =""
'--- DISPLAY PROCESS DETAILS 1 BY 1 ----
Set colItems = objWMIService.ExecQuery("Select * from Win32_Process",,48)
For Each objItem in colItems
msg = "Process : " & UCASE(objItem.Caption)
msg = msg & vbcrlf & "--------------------------------------------------------------"
msg = msg & vbcrlf & "CommandLine: " & objItem.CommandLine
msg = msg & vbcrlf & "CreationClassName: " & objItem.CreationClassName
msg = msg & vbcrlf & "CreationDate: " & objItem.CreationDate
msg = msg & vbcrlf & "CSCreationClassName: " & objItem.CSCreationClassName
msg = msg & vbcrlf & "CSName: " & objItem.CSName
msg = msg & vbcrlf & "Description: " & objItem.Description
msg = msg & vbcrlf & "ExecutablePath: " & objItem.ExecutablePath
msg = msg & vbcrlf & "ExecutionState: " & objItem.ExecutionState
msg = msg & vbcrlf & "Handle: " & objItem.Handle
msg = msg & vbcrlf & "HandleCount: " & objItem.HandleCount
msg = msg & vbcrlf & "InstallDate: " & objItem.InstallDate
msg = msg & vbcrlf & "KernelModeTime: " & objItem.KernelModeTime
msg = msg & vbcrlf & "MaximumWorkingSetSize: " & objItem.MaximumWorkingSetSize
msg = msg & vbcrlf & "MinimumWorkingSetSize: " & objItem.MinimumWorkingSetSize
a= msgbox(msg & vbcrlf & vbcrlf & vbtab & "......continue with next process....?",vbYESNO)
if a= VBNO then
Exit For
End IF
Next
CODE TO GET MORE INFORMATION
Wscript.Echo "Name: " & objItem.Name
Wscript.Echo "OSCreationClassName: " & objItem.OSCreationClassName
Wscript.Echo "OSName: " & objItem.OSName
Wscript.Echo "OtherOperationCount: " & objItem.OtherOperationCount
Wscript.Echo "OtherTransferCount: " & objItem.OtherTransferCount
Wscript.Echo "PageFaults: " & objItem.PageFaults
Wscript.Echo "PageFileUsage: " & objItem.PageFileUsage
Wscript.Echo "ParentProcessId: " & objItem.ParentProcessId
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 "ReadOperationCount: " & objItem.ReadOperationCount
Wscript.Echo "ReadTransferCount: " & objItem.ReadTransferCount
Wscript.Echo "SessionId: " & objItem.SessionId
Wscript.Echo "Status: " & objItem.Status
Wscript.Echo "TerminationDate: " & objItem.TerminationDate
Wscript.Echo "ThreadCount: " & objItem.ThreadCount
Wscript.Echo "UserModeTime: " & objItem.UserModeTime
Wscript.Echo "VirtualSize: " & objItem.VirtualSize
Wscript.Echo "WindowsVersion: " & objItem.WindowsVersion
Wscript.Echo "WorkingSetSize: " & objItem.WorkingSetSize
Wscript.Echo "WriteOperationCount: " & objItem.WriteOperationCount
Wscript.Echo "WriteTransferCount: " & objItem.WriteTransferCount
No comments:
Post a Comment