;2016-11-30 #include 'array.au3' #RequireAdmin Opt('MustDeclareVars', 1) ; ; Example 1 (Get all properties) Local $rtn = _WMIC_GET('COMPUTERSYSTEM') If $rtn < 0 Then MsgBox(0, '', $rtn) ElseIf IsArray($rtn) Then _ArrayDisplay($rtn) EndIf ; ; Example 2 (Get specific properties) Local $rtn = _WMIC_GET('COMPUTERSYSTEM', 'Manufacturer,Model,SystemType') If $rtn < 0 Then MsgBox(0, '', $rtn) ElseIf IsArray($rtn) Then _ArrayDisplay($rtn) EndIf Exit ; Func _WMIC_GET($sClass, $sProperty = '*') Local $pid = Run('WMIC ' & $sClass & ' GET ' & $sProperty & ' /format:LIST', '', @SW_HIDE, 2) If @error Or Not $pid Then Return -1 Local $s = '' ; Do Sleep(10) $s &= StdoutRead($pid) Until @error ; $s = StringStripWS(StringReplace($s, @CRLF, ''), 3) If StringLen($s) = 0 Then Return -2; no data ; Local $a = StringSplit($s, @CR) Local $array[$a[0] + 1][2] $array[0][0] = $a[0] Local $j ; For $i = 1 To $array[0][0] $j = StringSplit($a[$i], '=') If $j[0] = 1 Then ContinueLoop Else $array[$i][0] = $j[1] EndIf ; If $j[2] <> '' Then $array[$i][1] = $j[2] Else $array[$i][1] = '---'; no value found EndIf Next Return $array EndFunc ; #cs The following aliases are available in this current role: BASEBOARD - Base board (also known as a motherboard or system board) management. BIOS - Basic input/output services (BIOS) management. BOOTCONFIG - Boot configuration management. CDROM - CD-ROM management. COMPUTERSYSTEM - Computer system management. CPU - CPU management. CSPRODUCT - Computer system product information from SMBIOS. DESKTOP - User's Desktop management. DESKTOPMONITOR - Desktop Monitor management. DISKDRIVE - Physical disk drive management. DMACHANNEL - Direct memory access (DMA) channel management. GROUP - Group account management. IDECONTROLLER - IDE Controller management. IRQ - Interrupt request line (IRQ) management. JOB - Provides access to the jobs scheduled using the schedule service. LOADORDER - Management of system services that define execution dependencies. LOGICALDISK - Local storage device management. LOGON - LOGON Sessions. MEMCACHE - Cache memory management. MEMLOGICAL - System memory management (configuration layout and availability of memory). MEMPHYSICAL - Computer system's physical memory management. NETCLIENT - Network Client management. NETLOGIN - Network login information (of a particular user) management. NETPROTOCOL - Protocols (and their network characteristics) management. NETUSE - Active network connection management. NIC - Network Interface Controller (NIC) management. NICCONFIG - Network adapter management. NTDOMAIN - NT Domain management. NTEVENT - Entries in the NT Event Log. NTEVENTLOG - NT eventlog file management. ONBOARDDEVICE - Management of common adapter devices built into the motherboard (system board). OS - Installed Operating System/s management. PAGEFILE - Virtual memory file swapping management. PAGEFILESET - Page file settings management. PARTITION - Management of partitioned areas of a physical disk. PORT - I/O port management. PORTCONNECTOR - Physical connection ports management. PRINTER - Printer device management. PRINTERCONFIG - Printer device configuration management. PRINTJOB - Print job management. PROCESS - Process management. PRODUCT - Installation package task management. QFE - Quick Fix Engineering. QUOTASETTING - Setting information for disk quotas on a volume. RECOVEROS - Information that will be gathered from memory when the operating system fails. REGISTRY - Computer system registry management. SCSICONTROLLER - SCSI Controller management. SERVER - Server information management. SERVICE - Service application management. SHARE - Shared resource management. SOFTWAREELEMENT - Management of the elements of a software product installed on a system. SOFTWAREFEATURE - Management of software product subsets of SoftwareElement. SOUNDDEV - Sound Device management. STARTUP - Management of commands that run automatically when users log onto the computer system. SYSACCOUNT - System account management. SYSDRIVER - Management of the system driver for a base service. SYSTEMENCLOSURE - Physical system enclosure management. SYSTEMSLOT - Management of physical connection points including ports, slots and peripherals, and proprietary connections points. TAPEDRIVE - Tape drive management. TEMPERATURE - Data management of a temperature sensor (electronic thermometer). TIMEZONE - Time zone data management. UPS - Uninterruptible power supply (UPS) management. USERACCOUNT - User account management. VOLTAGE - Voltage sensor (electronic voltmeter) data management. VOLUMEQUOTASETTING - Associates the disk quota setting with a specific disk volume. WMISET - WMI service operational parameters management. #ce