Global $info
$strComputer = "."
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")
$xh = ''
$colChassis = $objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
For $objChassis In $colChassis
For $objItem In $objChassis.ChassisTypes
Switch $objItem
Case 1
$xh = "Other"
Case 2
$xh = "Unknown"
Case 3
$xh = "台式机";"Desktop"
Case 4
$xh = "Low Profile Desktop"
Case 5
$xh = "Pizza Box"
Case 6
$xh = "Mini Tower"
Case 7
$xh = "Tower"
Case 8
$xh = "Portable"
Case 9
$xh = "Laptop"
Case 10
$xh = "笔记本";"Notebook"
Case 11
$xh = "Handheld"
Case 12
$xh = "Docking Station"
Case 13
$xh = "All-in-One"
Case 14
$xh = "Sub-Notebook"
Case 15
$xh = "Space Saving"
Case 16
$xh = "Lunch Box"
Case 17
$xh = "Main System Chassis"
Case 18
$xh = "Expansion Chassis"
Case 19
$xh = "Sub-Chassis"
Case 20
$xh = "Bus Expansion Chassis"
Case 21
$xh = "Peripheral Chassis"
Case 22
$xh = "Storage Chassis"
Case 23
$xh = "Rack Mount Chassis"
Case 24
$xh = "Sealed-Case PC"
Case Else
$xh = "Unknown"
EndSwitch
; MsgBox(0, 0, "Chassis Type: " & $xh)
Next
Next
$info&="计算机类型:"&$xh&@CRLF
$mb=''
$colBoard = $objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard")
For $object In $colBoard
$mb = $object.Product
Next
$info&="主板型号:"&$mb&@CRLF
$computerModel = $objWMIService.ExecQuery("Select * from Win32_ComputerSystemProduct")
For $objItem in $computerModel
$computerModel2 = $objItem.vendor & $objItem.name & "(" & $objItem.IdentifyingNumber & ")"
Next
$info&="电脑型号:"&$computerModel2&@CRLF
MsgBox(0,'检测结果:',$info)
上面代码为PCBAR超版提供信息。可以获取计算机类型,主板型号,电脑型号
另外请教可不可以获取主板是INTEL的还是AMD的?? |