#include <array.au3>
Global $wbemFlagReturnImmediately = 0x10, _ ;DO NOT CHANGE
$wbemFlagForwardOnly = 0x20 ;DO NOT CHANGE
local $aa
_ComputerGetProcessors($aa)
_ArrayDisplay($aa)
Func _ComputerGetProcessors(ByRef $aProcessorInfo)
Local $colItems, $objWMIService, $objItem
Dim $aProcessorInfo[1][42], $i = 1
$objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Processor", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly)
If IsObj($colItems) Then
For $objItem In $colItems
ReDim $aProcessorInfo[UBound($aProcessorInfo) + 1][42]
$aProcessorInfo[$i][0] = StringStripWS($objItem.Name, 1)
$aProcessorInfo[$i][1] = $objItem.AddressWidth
$aProcessorInfo[$i][2] = $objItem.Architecture
$aProcessorInfo[$i][3] = $objItem.Availability
$aProcessorInfo[$i][4] = $objItem.Description
$aProcessorInfo[$i][5] = $objItem.ConfigManagerErrorCode
$aProcessorInfo[$i][6] = $objItem.ConfigManagerUserConfig
$aProcessorInfo[$i][7] = $objItem.CpuStatus
$aProcessorInfo[$i][8] = $objItem.CreationClassName
$aProcessorInfo[$i][9] = $objItem.CurrentClockSpeed
$aProcessorInfo[$i][10] = $objItem.CurrentVoltage
$aProcessorInfo[$i][11] = $objItem.DataWidth
$aProcessorInfo[$i][12] = $objItem.DeviceID
$aProcessorInfo[$i][13] = $objItem.ErrorCleared
$aProcessorInfo[$i][14] = $objItem.ErrorDescription
$aProcessorInfo[$i][15] = $objItem.ExtClock
$aProcessorInfo[$i][16] = $objItem.Family
$aProcessorInfo[$i][17] = $objItem.L2CacheSize
$aProcessorInfo[$i][18] = $objItem.L2CacheSpeed
$aProcessorInfo[$i][19] = $objItem.LastErrorCode
$aProcessorInfo[$i][20] = $objItem.Level
$aProcessorInfo[$i][21] = $objItem.LoadPercentage
$aProcessorInfo[$i][22] = $objItem.Manufacturer
$aProcessorInfo[$i][23] = $objItem.MaxClockSpeed
$aProcessorInfo[$i][24] = $objItem.OtherFamilyDescription
$aProcessorInfo[$i][25] = $objItem.PNPDeviceID
$aProcessorInfo[$i][26] = $objItem.PowerManagementCapabilities(0)
$aProcessorInfo[$i][27] = $objItem.PowerManagementSupported
$aProcessorInfo[$i][28] = $objItem.ProcessorId
$aProcessorInfo[$i][29] = $objItem.ProcessorType
$aProcessorInfo[$i][30] = $objItem.Revision
$aProcessorInfo[$i][31] = $objItem.Role
$aProcessorInfo[$i][32] = $objItem.SocketDesignation
$aProcessorInfo[$i][33] = $objItem.Status
$aProcessorInfo[$i][34] = $objItem.StatusInfo
$aProcessorInfo[$i][35] = $objItem.Stepping
$aProcessorInfo[$i][36] = $objItem.SystemCreationClassName
$aProcessorInfo[$i][37] = $objItem.SystemName
$aProcessorInfo[$i][38] = $objItem.UniqueId
$aProcessorInfo[$i][39] = $objItem.UpgradeMethod
$aProcessorInfo[$i][40] = $objItem.Version
$aProcessorInfo[$i][41] = $objItem.VoltageCaps
$i += 1
Next
$aProcessorInfo[0][0] = UBound($aProcessorInfo) - 1
If $aProcessorInfo[0][0] < 1 Then
SetError(1, 1, 0)
EndIf
Else
SetError(1, 2, 0)
EndIf
EndFunc ;_ComputerGetProcessors
|