请教如何用AU3获得电脑的OEM品牌
本帖最后由 feelsky 于 2011-5-9 07:05 编辑本人想法是软件能自动对应不同品牌电脑在我的电脑属性中添加OEM信息。
oemlogo.bmp图片和oeminfo.ini信息
请教在AU3脚本中能获得相关参数实现上面的功能吗?
请看七楼 不太明白,你的意思是获取到电脑的品牌吗,那样的话,获取主板相关信息就可以知道了,然后对应的进行添加OEM信息 回复 2# wsfda
估计楼主要的不是这个,是控制面板系统里那些玩意,如果是都在system32文件夹里面 本帖最后由 502762378 于 2011-5-7 22:07 编辑
这个应该可以,给你个思路
首先WMI获得主板型号
你那边要定义什么主板什么 品牌,不通品牌图片也要准备
开机判断主板,复制相应LOG到C:\WINDOWS\system32\oemlogo.bmp,
写入oeminfo.ini文件
manufacturer=对应的品牌 不太明白,你的意思是获取到电脑的品牌吗,那样的话,获取主板相关信息就可以知道了,然后对应的进行添加OE ...
wsfda 发表于 2011-5-7 21:08 http://www.autoitx.com/images/common/back.gif
就是这个意思,问题就是不知道如何用AU3获取主板相关信息
$wbemFlagReturnImmediately = 0x10
$wbemFlagForwardOnly = 0x20
$strComputer = "localhost"
$objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
$colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BaseBoard", "WQL", _
$wbemFlagReturnImmediately + $wbemFlagForwardOnly)
For $objItem In $colItems
MsgBox(1,"主板是?",$objItem.Product)
Next
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的?? 回复 7# feelsky
可以,通过WMI查询
在本站搜“硬件信息”,就会出来一大堆 谢谢各位,ok 不错,7楼得代码可以收藏了
页:
[1]