Jump to content

memgetstats


Recommended Posts

Search forum for CompInfo.au3:

;===============================================================================
; Description:      Returns the Process information in an array.
; Parameter(s):     $aProcessInfo - By Reference - Process Information array.
; Requirement(s):   None
; Return Value(s):  On Success - Returns array of Process Information.
;                       $aProcessInfo[0][0]   = Number of Processes
;                       $aProcessInfo[$i][0]  = Name ($i starts at 1)
;                       $aProcessInfo[$i][1]  = Command Line
;                       $aProcessInfo[$i][2]  = Creation Class Name
;                       $aProcessInfo[$i][3]  = Creation Date
;                       $aProcessInfo[$i][4]  = Description
;                       $aProcessInfo[$i][5]  = CS Creation Class Name
;                       $aProcessInfo[$i][6]  = CS Name
;                       $aProcessInfo[$i][7]  = Executable Path
;                       $aProcessInfo[$i][8]  = Execution State
;                       $aProcessInfo[$i][9]  = Handle
;                       $aProcessInfo[$i][10] = Handle Count
;                       $aProcessInfo[$i][11] = Kernel Mode Time
;                       $aProcessInfo[$i][12] = Maximum Working Set Size
;                       $aProcessInfo[$i][13] = Minimum Working Set Size
;                       $aProcessInfo[$i][14] = OS Creation Class Name
;                       $aProcessInfo[$i][15] = OS Name
;                       $aProcessInfo[$i][16] = Other Operation Count
;                       $aProcessInfo[$i][17] = Other Transfer Count
;                       $aProcessInfo[$i][18] = Page Faults
;                       $aProcessInfo[$i][19] = Page File Usage
;                       $aProcessInfo[$i][20] = Parent Process ID
;                       $aProcessInfo[$i][21] = Peak Page File Usage
;                       $aProcessInfo[$i][22] = Peak Virtual Size
;                       $aProcessInfo[$i][23] = Peak Working Set Size
;                       $aProcessInfo[$i][24] = Priority
;                       $aProcessInfo[$i][25] = Private Page Count
;                       $aProcessInfo[$i][26] = Process ID
;                       $aProcessInfo[$i][27] = Quota Non Paged Pool Usage
;                       $aProcessInfo[$i][28] = Quota Paged Pool Usage
;                       $aProcessInfo[$i][29] = Quota Peak Non Paged Pool Usage
;                       $aProcessInfo[$i][30] = Quota Peak Paged Pool Usage
;                       $aProcessInfo[$i][31] = Read Operation Count
;                       $aProcessInfo[$i][32] = Read Transfer Count
;                       $aProcessInfo[$i][33] = Session ID
;                       $aProcessInfo[$i][34] = Status
;                       $aProcessInfo[$i][35] = Thread Count
;                       $aProcessInfo[$i][36] = User Mode Time
;                       $aProcessInfo[$i][37] = Virtual Size
;                       $aProcessInfo[$i][38] = Windows Version
;                       $aProcessInfo[$i][39] = Working Set Size
;                       $aProcessInfo[$i][40] = Write Operation Count
;                       $aProcessInfo[$i][41] = Write Transfer Count
;                   On Failure - @error = 1 and Returns 0
;                               @extended = 1 - Array contains no information
;                                           2 - $colItems isnt an object
; Author(s):        Jarvis Stubblefield (support "at" vortexrevolutions "dot" com)
; Note(s):
;===============================================================================
Func _ComputerGetProcesses(ByRef $aProcessInfo)
    Local $colItems, $objWMIService, $objItem
    Dim $aProcessInfo[1][42], $i = 1
    
    $objWMIService = ObjGet("winmgmts:\\" & $cI_Compname & "\root\CIMV2")
    $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
    
    If IsObj($colItems) Then
        For $objItem In $colItems
            ReDim $aProcessInfo[UBound($aProcessInfo) + 1][42]
            $aProcessInfo[$i][0]  = $objItem.Name
            $aProcessInfo[$i][1]  = $objItem.CommandLine
            $aProcessInfo[$i][2]  = $objItem.CreationClassName
            $aProcessInfo[$i][3]  = __StringToDate($objItem.CreationDate)
            $aProcessInfo[$i][4]  = $objItem.Description
            $aProcessInfo[$i][5]  = $objItem.CSCreationClassName
            $aProcessInfo[$i][6]  = $objItem.CSName
            $aProcessInfo[$i][7]  = $objItem.ExecutablePath
            $aProcessInfo[$i][8]  = $objItem.ExecutionState
            $aProcessInfo[$i][9]  = $objItem.Handle
            $aProcessInfo[$i][10] = $objItem.HandleCount
            $aProcessInfo[$i][11] = $objItem.KernelModeTime
            $aProcessInfo[$i][12] = $objItem.MaximumWorkingSetSize
            $aProcessInfo[$i][13] = $objItem.MinimumWorkingSetSize
            $aProcessInfo[$i][14] = $objItem.OSCreationClassName
            $aProcessInfo[$i][15] = $objItem.OSName
            $aProcessInfo[$i][16] = $objItem.OtherOperationCount
            $aProcessInfo[$i][17] = $objItem.OtherTransferCount
            $aProcessInfo[$i][18] = $objItem.PageFaults
            $aProcessInfo[$i][19] = $objItem.PageFileUsage
            $aProcessInfo[$i][20] = $objItem.ParentProcessId
            $aProcessInfo[$i][21] = $objItem.PeakPageFileUsage
            $aProcessInfo[$i][22] = $objItem.PeakVirtualSize
            $aProcessInfo[$i][23] = $objItem.PeakWorkingSetSize
            $aProcessInfo[$i][24] = $objItem.Priority
            $aProcessInfo[$i][25] = $objItem.PrivatePageCount
            $aProcessInfo[$i][26] = $objItem.ProcessId
            $aProcessInfo[$i][27] = $objItem.QuotaNonPagedPoolUsage
            $aProcessInfo[$i][28] = $objItem.QuotaPagedPoolUsage
            $aProcessInfo[$i][29] = $objItem.QuotaPeakNonPagedPoolUsage
            $aProcessInfo[$i][30] = $objItem.QuotaPeakPagedPoolUsage
            $aProcessInfo[$i][31] = $objItem.ReadOperationCount
            $aProcessInfo[$i][32] = $objItem.ReadTransferCount
            $aProcessInfo[$i][33] = $objItem.SessionId
            $aProcessInfo[$i][34] = $objItem.Status
            $aProcessInfo[$i][35] = $objItem.ThreadCount
            $aProcessInfo[$i][36] = $objItem.UserModeTime
            $aProcessInfo[$i][37] = $objItem.VirtualSize
            $aProcessInfo[$i][38] = $objItem.WindowsVersion
            $aProcessInfo[$i][39] = $objItem.WorkingSetSize
            $aProcessInfo[$i][40] = $objItem.WriteOperationCount
            $aProcessInfo[$i][41] = $objItem.WriteTransferCount
            $i += 1
        Next
        $aProcessInfo[0][0] = UBound($aProcessInfo) - 1
        If $aProcessInfo[0][0] < 1 Then
            SetError(1, 1, 0)
        EndIf
    Else
        SetError(1, 2, 0)
    EndIf
EndFunc ;_ComputerGetProcesses
Link to comment
Share on other sites

Check out My MemStats (in the sig)

$mem = MemGetStats()
MsgBox(0,"Ram","% of RAM in use:" & $mem[0])

$array[0] = Memory Load (Percentage of memory in use)

$array[1] = Total physical RAM

$array[2] = Available physical RAM

$array[3] = Total Pagefile

$array[4] = Available Pagefile

$array[5] = Total virtual

$array[6] = Available virtual

Edited by AutoItKing
http://www.autoitking.co.nr Site is DOWN | My deviantART | No Topic Topic - Don't do it!-------------------- UDF's/Scripts:AutoIt: [BenEditor 3.6] [_ShutDown()]PHP: [CommentScript]Web Based AutoIt: [MemStats] [HTML to AU3] [User LogIn and SignUp script]
Link to comment
Share on other sites

: WARNING: $cI_Compname: possibly used before declaration.

i tried compuinfo.au3, yet it says above.

where is the original file you downloaded? I found the thread yet i couldnt tell which one of those version you linked for me.

Link to comment
Share on other sites

: WARNING: $cI_Compname: possibly used before declaration.

i tried compuinfo.au3, yet it says above.

where is the original file you downloaded? I found the thread yet i couldnt tell which one of those version you linked for me.

It's from JSThePatriot look here

I gave you just info to go to right direction. Make some work yourself.

I don't use this function I just know about it and I shared my knowledge with you.

Edited by Zedna
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...