Created
February 3, 2013 01:33
-
-
Save ddhahn/4700125 to your computer and use it in GitHub Desktop.
Writes data from WMI to OEMINFO.ini
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;Generate oeminfo.ini from wmi | |
;WMI stuff taken from: http://cyrusbuilt.net/wordpress/?p=79 | |
$objWMI = ObjGet("winmgmts:\\localhost\root\CIMV2") | |
$wbemFlagReturnImmediately = 0x10 | |
$wbemFlagForwardOnly = 0x20 | |
$objItems = $objWMI.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", 0x10 + 0x20) | |
If IsObj($objItems) Then | |
For $objItem In $objItems | |
iniwrite("c:\windows\system32\oeminfo.ini", "General","Model",$objitem.Model) | |
iniwrite("c:\windows\system32\oeminfo.ini", "General","Manufacturer",$objitem.Manufacturer) | |
;ConsoleWrite("Manufacturer: " & $objItem.Manufacturer) | |
;ConsoleWrite("Model: " & $objItem.Model) | |
;ConsoleWrite("Name: " & $objItem.Caption) | |
;ConsoleWrite("Description: " & $objItem.Description) | |
Next | |
EndIf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment