kev_147 Posted June 26, 2006 Posted June 26, 2006 I have posted the following in the programming section, but am not sure if this is a more appropriate section. Admin please delete the one you feel should go if its a problem having them in 2 places.Would it be possible with the use of WMI and VB to automatically create an oeminfo.ini file for use within Windows?Here is the sample from MS:[General]Manufacturer = MyCompany, Inc.Model = Brand X ProcessorSupportURL = http://www.mycompany.comLocalFile = C:\Winnt\Web\LocalFilename.htm[support Information]Line1= For Technical Support:Line2= to obtain updated drivers or for information on frequentlyLine3= asked questions, visit the MyCompany technicalLine4= support web site at:Line5= Line6= http://www.mycompany.com/techsupport. Would it be possible for WMI to enter Manufacturer, Model and add other information such as CPU, Ram, HDD, Graphics and Sound Card information under the general tab. As well as creating the lines under support information?then to save all this information to %SYSTEMROOT%\System32\oeminfo.iniIf this could be done, i think it will be a useful script that can be used in an UA install or manual install and will be easy for an end user to se what is installed in their PC and for IT professionals for more efficint hardware auditing.What do people think, worth looking into?? / ??
Bezalel Posted June 26, 2006 Posted June 26, 2006 You could get the Manufacturer and Model using WMI (and Serial# if you know where that partiucular manufacturer keeps it). The first time you can use WMI is during GuiRunOnce. There is no way to get the support information using WMI so either you will have to leave it out or create a template (or select from multiple templates based on the manufacturer).I am working on a project the reads the SMBIOS table directly from memory bypassing WMI so that I can have this information availabe from cmdlines.txt.
kev_147 Posted June 26, 2006 Author Posted June 26, 2006 (edited) sorry m8, I worded that wrong. I would like wmi to get manufacturer, model, serial number, cpu, ram, hdd, graphics and sound card info and output this to an oeminfo.ini. I know howto get some of the information, but don't know how to add it to an oeminfo.ini file and to wscript.echo out to the correct line. Can you wscript.echo out to a specific line in an .ini file? If so how?I was thinking that you could wscript.echo "[General]" to line 1, "Manufacturer = " & objItem.Manufacturer to Line 2, "Model = " & objItem.Model to Line 3, Line 4 can be a blank line, "[Hardware]" to line 5, "Total Physical Memory = " & objItem.TotalPhysicalMemory to Line 6, "[support Information]" to Line 12, and so on and save all of this into %systemroot%\system32\oeminfo.ini'---------------------------------------------------------------------------------------------------------------------On Error Resume NextConst wbemFlagReturnImmediately = &h10Const wbemFlagForwardOnly = &h20arrComputers = Array("PC2") ;How do i get a computername variable in here??For Each strComputer In arrComputers Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItems WScript.Echo "Manufacturer: " & objItem.Manufacturer WScript.Echo "Model: " & objItem.Model WScript.Echo "TotalPhysicalMemory: " & objItem.TotalPhysicalMemory NextNextFor Each strComputer In arrComputersSet objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ wbemFlagReturnImmediately + wbemFlagForwardOnly) For Each objItem In colItemsWScript.Echo "SerialNumber: " & objItem.SerialNumber NextNextFunction WMIDateStringToDate(dtmDate)WScript.Echo dtm: WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _ Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _ & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))End Function Edited June 26, 2006 by kev_147
kev_147 Posted June 27, 2006 Author Posted June 27, 2006 Please goto:http://www.msfn.org/board/index.php?showto...pid=525429&for further info on this. I wont update this post no more as it may become confusing
RogueSpear Posted June 28, 2006 Posted June 28, 2006 (edited) You may want to check out some of the sample code that GunSmokingMan has posted or even go to my thread for the post install script pack. You're bound to find an example of just about anything that you would ever need.EDIT: I just saw that you've done that Edited June 28, 2006 by RogueSpear
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now