Skip to content

Instantly share code, notes, and snippets.

@ddhahn
Created February 3, 2013 01:33
Show Gist options
  • Save ddhahn/4700125 to your computer and use it in GitHub Desktop.
Save ddhahn/4700125 to your computer and use it in GitHub Desktop.
Writes data from WMI to OEMINFO.ini
;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