GaryFrost Posted June 28, 2005 Share Posted June 28, 2005 (edited) #include <Array.au3> $colItems = "" $strComputer = "localhost" $a_ProcessInfo = _GetProcessInfo($strComputer) For $i = 1 To $a_ProcessInfo[0] $process = StringSplit($a_ProcessInfo[$i], "|") MsgBox(0, "Process Info", "Name: " & $process[1] & @CRLF & _ "PID: " & $process[2] & @CRLF & _ "Memory: " & $process[3]) Next Func _GetProcessInfo($strComputer) Dim $a_items[1] Const $wbemFlagReturnImmediately = 0x10 Const $wbemFlagForwardOnly = 0x20 Dim $a_items[1], $objWMIService, $colItems = "" $objWMIService = ObjGet ("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery ("SELECT Name,IDProcess,WorkingSet FROM Win32_PerfFormattedData_PerfProc_Process", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj ($colItems) Then For $objItem In $colItems If $objItem.Name <> "_Total" Then ReDim $a_items[UBound($a_items) + 1] $a_items[UBound($a_items) - 1] = $objItem.Name & "|" & $objItem.IDProcess & "|" & $objItem.WorkingSet $a_items[0] = $a_items[0] + 1 EndIf Next EndIf _ArraySort($a_items) Return $a_items EndFunc ;==>_GetProcessInfo Edited June 28, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Valuater Posted June 30, 2005 Share Posted June 30, 2005 a user in support forum asked for pids.... this is perfect thx 8) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now