Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


kev_147

Automatic creation of oeminfo.ini

Recommended Posts

looking really good gsh. Should of asked this before, but is there a way to add details of the HDD as well, then it is near enough a full hardware audit in 1 place. eg easy for an engineer to see what is installed within the PC.

Might also be worth adding the info for system type. ie Laptop or Desktop.

What do you reckon? Possible?

Share this post


Link to post
Share on other sites

I have added a basic list drives to the script

What It Makes

[General]
Manufacturer = ECS
Model Type = L7VMM3

[Support Information]
Line1= For Technical Support:
Line2= to obtain updated drivers or for information on frequently
Line3= asked questions, visit the MyCompany technical
Line4= support web site at:
Line5=
Line6= http://www.mycompany.com/techsupport.
Line7=
Line8= « OPERATING SYSTEM INFORMATION »
Line9= OS Name Microsoft Windows XP Professional
Line10= OS Version 5.1.2600
Line11= Install Date 2/27/2006 2:18:38 AM
Line12= Computer Name BETA-HOME-ON_C
Line13= Organization Home-Beta-2004
Line14=
Line15= « MOTHERBOARD INFORMATION »
Line16= Manufacturer ECS
Line17= Description AT/AT COMPATIBLE
Line18= Model Type L7VMM3
Line19= System Type X86-based PC
Line20=
Line21= « CPU INFORMATION »
Line22= Manufacturer AuthenticAMD
Line23= CPU Name AMD Athlon(tm) XP 2000+
Line24= Description x86 Family 6 Model 8 Stepping 0
Line25= Processor Speed 1672 MHZ
Line26= L2 Cache Size 256
Line27= L2 Cache Speed 557 MHZ
Line28=
Line29= « GRAPHICS CARD INFORMATION »
Line30= Description RADEON 9200 SE Family (Microsoft Corporation)
Line31= Driver Version 6.14.10.6462
Line32= Adapter RAM 128 MB
Line33= Adapter DAC Type Internal DAC(500MHz)
Line34=
Line35= « SOUND CARD INFORMATION »
Line36= Manufacturer VIA Technologies, Inc.
Line37= Description Vinyl AC'97 Codec Combo Driver (WDM)
Line38=
Line39= « NETWORK ADAPTER INFORMATION »
Line40= Name VIA Rhine II Fast Ethernet Adapter
Line41= Manufacturer VIA Technologies, Inc.
Line42= IP Address 206.116.20.121
Line43=
Line44= « HARDWARE ABSTRACTION LAYER INFORMATION »
Line45= HAL DETAILS
Line46= Advanced Configuration and Power Interface (ACPI) PC
Line47=
Line48= « FLOPPY CD_DvD HARDDRIVE INFORMATION »
Line49= FloppyDisk A:\
Line50= Hard Drive C:\ Disk Size » 13.13 GB
Line51= Hard Drive D:\ Disk Size » 25.93 GB
Line52= Hard Drive E:\ Disk Size » 37.24 GB
Line53= Hard Drive F:\ Disk Size » 12.45 GB
Line54= Hard Drive G:\ Disk Size » 12.68 GB
Line55= Hard Drive H:\ Disk Size » 23.97 GB
Line56= Hard Drive I:\ Disk Size » 24.65 GB
Line57= CD_DVD Drive J:\
Line58= CD_DVD Drive L:\

Save As MkOem_v4.Vbs

'/-> Script By Gunsmokingman
Option Explicit
'/->
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
'/->
Dim objFolder, Ts, objFile
Dim ObjWMI, objItem, colItems
Dim dtmDate, dtm
Dim Cnt, i, IP
'/->
Dim Act : Set Act = CreateObject("Wscript.Shell")
Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")
Dim Sys32 : Sys32 = act.ExpandEnvironmentStrings("%Windir%\System32")
Dim Ini : Ini = "\oeminfo.ini"
Dim strComputer : strComputer = "."
Dim VBS : VBS = Act.ExpandEnvironmentStrings("%SystemDrive%\MkOem_v4.Vbs")
'/->
Dim MB : MB = 1024 * 1024
Dim GB : GB = 1024 * 1024 * 1024
Dim S_3 : S_3 = Space(3)
Dim S_5 : S_5 = Space(5)
Dim TitleL : TitleL = S_5 & Chr(171) & S_3
Dim TitleR : TitleR = S_3 & Chr(187) & S_5
Dim WmiVar : WmiVar = wbemFlagReturnImmediately + wbemFlagForwardOnly
'/->
Set Ts = Fso.OpenTextFile(Sys32 & Ini, 2, True)
'/->
' WMI Section
'/->
Set ObjWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", WmiVar)
'/----------------------------------------------------------------------->
For Each objItem In colItems
Ts.WriteLine "[General]"
Ts.WriteLine "Manufacturer = " & objItem.Manufacturer
Ts.WriteLine "Model Type = " & objItem.Model
Ts.WriteLine ""
Next
'/----------------------------------------------------------------------->
Ts.WriteLine "[Support Information]"
Ts.WriteLine "Line1= For Technical Support:"
Ts.WriteLine "Line2= to obtain updated drivers or for information on frequently"
Ts.WriteLine "Line3= asked questions, visit the MyCompany technical"
Ts.WriteLine "Line4= support web site at:"
Ts.WriteLine "Line5="
Ts.WriteLine "Line6= http://www.mycompany.com/techsupport."
Ts.WriteLine "Line7="
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", WmiVar)
'/----------------------------------------------------------------------->
For Each objItem In colItems
Ts.WriteLine "Line8= " & TitleL & "OPERATING SYSTEM INFORMATION" & TitleR
Ts.WriteLine "Line9= " & S_3 & "OS Name " & vbTab & objItem.Caption
Ts.WriteLine "Line10=" & S_3 & "OS Version " & vbTab & objItem.Version
Ts.WriteLine "Line11=" & S_3 & "Install Date " & vbTab & WMIDateStringToDate(objItem.InstallDate)
Ts.WriteLine "Line12=" & S_3 & "Computer Name " & vbTab & objItem.CSName
Ts.WriteLine "Line13=" & S_3 & "Organization " & vbTab & objItem.Organization
Ts.WriteLine "Line14="
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", WmiVar)
'/----------------------------------------------------------------------->
For Each objItem In colItems
Ts.WriteLine "Line15=" & TitleL & "MOTHERBOARD INFORMATION" & TitleR
Ts.WriteLine "Line16=" & S_3 & "Manufacturer " & vbTab & objItem.Manufacturer
Ts.WriteLine "Line17=" & S_3 & "Description " & vbTab & objItem.Description
Ts.WriteLine "Line18=" & S_3 & "Model Type " & vbTab & objItem.Model
Ts.WriteLine "Line19=" & S_3 & "System Type " & vbTab & objItem.SystemType
Ts.WriteLine "Line20="
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_Processor", "WQL", WmiVar)
'/----------------------------------------------------------------------->
For Each objItem In colItems
Ts.WriteLine "Line21=" & TitleL & "CPU INFORMATION" & TitleR
Ts.WriteLine "Line22=" & S_3 & "Manufacturer " & vbTab & objItem.Manufacturer
Ts.WriteLine "Line23=" & S_3 & "CPU Name " & vbTab & objItem.Name
Ts.WriteLine "Line24=" & S_3 & "Description " & vbTab & objItem.Description
Ts.WriteLine "Line25=" & S_3 & "Processor Speed " & vbTab & objItem.CurrentClockSpeed & " MHZ"
Ts.WriteLine "Line26=" & S_3 & "L2 Cache Size " & vbTab & objItem.L2CacheSize
Ts.WriteLine "Line27=" & S_3 & "L2 Cache Speed " & vbTab & objItem.L2CacheSpeed & " MHZ"
Ts.WriteLine "Line28="
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_VideoController", "WQL", WmiVar)
'/----------------------------------------------------------------------->
For Each objItem In colItems
Cnt = Cnt + 1
If Cnt = 1 Then
Ts.WriteLine "Line29=" & TitleL & "GRAPHICS CARD INFORMATION" & TitleR
Ts.WriteLine "Line30=" & S_3 & "Description " & vbTab & objItem.Description
Ts.WriteLine "Line31=" & S_3 & "Driver Version " & vbTab & objItem.DriverVersion
Ts.WriteLine "Line32=" & S_3 & "Adapter RAM " & vbTab & objItem.AdapterRAM /MB & " MB"
Ts.WriteLine "Line33=" & S_3 & "Adapter DAC Type " & vbTab & objItem.AdapterDACType
Ts.WriteLine "Line34="
End If
Next
'/-> Reset Cnt To Zero
Cnt = 0
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_SoundDevice", "WQL", WmiVar)
'/----------------------------------------------------------------------->
For Each objItem In colItems
If InStr(objItem.DeviceID, "PCI") Then
Ts.WriteLine "Line35=" & TitleL & "SOUND CARD INFORMATION" & TitleR
Ts.WriteLine "Line36=" & S_3 & "Manufacturer " & vbTab & objItem.Manufacturer
Ts.WriteLine "Line37=" & S_3 & "Description " & vbTab & objItem.Description
Ts.WriteLine "Line38="
End If
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery ("Select IPAddress from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
'/----------------------------------------------------------------------->
For Each objItem in colItems
If Not IsNull(objItem.IPAddress) Then
For i=LBound(objItem.IPAddress) To UBound(objItem.IPAddress)
IP = objItem.IPAddress(i)
Next
End If
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", WmiVar)
'/----------------------------------------------------------------------->
Cnt = 1
For Each objItem in colItems
If Cnt = 1 Then
Ts.WriteLine "Line39=" & TitleL & "NETWORK ADAPTER INFORMATION" & TitleR
Ts.WriteLine "Line40=" & S_3 & "Name " & vbTab & objItem.Name
Ts.WriteLine "Line41=" & S_3 & "Manufacturer " & vbTab & objItem.Manufacturer
Ts.WriteLine "Line42=" & S_3 & "IP Address " & vbTab & IP
Ts.WriteLine "Line43="
Exit For
End If
Next
Cnt = 0
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_PnPEntity where ClassGuid = '{4D36E966-E325-11CE-BFC1-08002BE10318}'",,48)
'/----------------------------------------------------------------------->
For Each objItem in colItems
Ts.WriteLine "Line44=" & TitleL & "HARDWARE ABSTRACTION LAYER INFORMATION" & TitleR
Ts.WriteLine "Line45=" & S_3 & "HAL DETAILS "
Ts.WriteLine "Line46=" & S_3 & objItem.Name
Ts.WriteLine "Line47="
Next
'/----------------------------------------------------------------------->
Set colItems = ObjWMI.ExecQuery("SELECT * FROM Win32_LogicalDisk", "WQL", WmiVar)
'/----------------------------------------------------------------------->
Dim DrvType, Rpt
Ts.WriteLine "Line48=" & TitleL & "FLOPPY CD_DvD HARDDRIVE INFORMATION" & TitleR
For Each objItem in colItems
DrvType = objItem.MediaType
Cnt = Cnt + 1
CheckDrvType()
If Cnt = 1 Then Ts.WriteLine "Line49=" & Rpt End If
If Cnt = 2 Then Ts.WriteLine "Line50=" & Rpt End If
If Cnt = 3 Then Ts.WriteLine "Line51=" & Rpt End If
If Cnt = 4 Then Ts.WriteLine "Line52=" & Rpt End If
If Cnt = 5 Then Ts.WriteLine "Line53=" & Rpt End If
If Cnt = 6 Then Ts.WriteLine "Line54=" & Rpt End If
If Cnt = 7 Then Ts.WriteLine "Line55=" & Rpt End If
If Cnt = 8 Then Ts.WriteLine "Line56=" & Rpt End If
If Cnt = 9 Then Ts.WriteLine "Line57=" & Rpt End If
If Cnt = 10 Then Ts.WriteLine "Line58=" & Rpt End If
If Cnt = 11 Then Ts.WriteLine "Line59=" & Rpt End If
If Cnt = 12 Then Ts.WriteLine "Line60=" & Rpt End If
If Cnt = 13 Then Ts.WriteLine "Line61=" & Rpt End If
If Cnt = 14 Then Ts.WriteLine "Line62=" & Rpt End If
If Cnt = 15 Then Ts.WriteLine "Line63=" & Rpt End If
If Cnt = 16 Then Ts.WriteLine "Line64=" & Rpt End If
If Cnt = 17 Then Ts.WriteLine "Line65=" & Rpt End If
If Cnt = 18 Then Ts.WriteLine "Line66=" & Rpt End If
If Cnt = 19 Then Ts.WriteLine "Line67=" & Rpt End If
If Cnt = 20 Then Ts.WriteLine "Line68=" & Rpt End If
If Cnt = 21 Then Ts.WriteLine "Line69=" & Rpt End If
If Cnt = 22 Then Ts.WriteLine "Line70=" & Rpt End If
If Cnt = 23 Then Ts.WriteLine "Line71=" & Rpt End If
If Cnt = 24 Then Ts.WriteLine "Line72=" & Rpt End If
If Cnt = 25 Then Ts.WriteLine "Line73=" & Rpt End If
If Cnt = 26 Then Ts.WriteLine "Line74=" & Rpt End If
Rpt = ""
Next
Cnt = 0
'/----------------------------------------------------------------------->
Function WMIDateStringToDate(dtmDate)
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
'/----------------------------------------------------------------------->
Function CheckDrvType()
'/-> Floppy Disk Check
If DrvType = 5 then
Rpt = S_3 & "FloppyDisk " & vbTab & objItem.Name & "\"
End If
'/-> CD Or DVD Check
If DrvType = 11 Then
Rpt = S_3 & "CD_DVD Drive " & vbTab & objItem.Name & "\"
End If
'/-> Hard Drive Check
If DrvType = 12 Then
Rpt = S_3 & "Hard Drive " & vbTab & objItem.Name & "\" & vbTab & "Disk Size" & Space(2) &_
Chr(187) & Space(2) & (Left(Round(objItem.Size /GB, 5),5)) & " GB"
End If
End Function
'/----------------------------------------------------------------------->
Ts.Close
Act.Run("Notepad.exe " & Sys32 & Ini)
If Fso.FileExists(VBS) Then Fso.DeleteFile(VBS) End If

Updated MkOem_V6

Edited by gunsmokingman

Share this post


Link to post
Share on other sites

GSH, thanks for all your help on this. I think it is a pretty neat and very useful script now.

I have just incorporated it into my automated install of Windows XP.

Share this post


Link to post
Share on other sites
GSH, thanks for all your help on this. I think it is a pretty neat and very useful script now.

I have just incorporated it into my automated install of Windows XP.

Thank you for the idea I hope you like what it produces now.

It also GSM and not GSH :D

Share this post


Link to post
Share on other sites

this is quality and makes me wish i could find time to learn vbs a seems to be a very useful tool

[edit

just applied this and the Support Information button doesn't report everything that i see in the actual .ini file.

Is this just me? am thinking that maybe it has a display of information limit

[/edit]

Edited by oioldman

Share this post


Link to post
Share on other sites

I get 2 different results running the script on 2 different computers.

On my AMD it reports every thing in the support button but on a older

P3 the ini is made but the support button is not added. I do not know

why this happens.

Share this post


Link to post
Share on other sites

bizarre!

if you want to investigate further, i can send/upload the oeminfo.ini file, but as it does capture all i can just use that.

thanks again

P.S do you run this as part of an unattended install? and if so, when do you apply it.

Share this post


Link to post
Share on other sites
GSH, thanks for all your help on this. I think it is a pretty neat and very useful script now.

I have just incorporated it into my automated install of Windows XP.

Thank you for the idea I hope you like what it produces now.

It also GSM and not GSH :D

I appreciate the significant effort you've put into this tool, but maybe I could ask for a bit more? Let me explain.

I am developing a hardware agnostic image for use in the corp environment. We have a lot of different flavors of hardware, and it would be very useful to have a script like this that could be executed from cmdlines / guirunonce during minisetup or first boot to autodetect the PC Manufacturer, model, serial #, & BIOS rev level, and then output it to winnt/system32 to overwrite the default oeminfo.ini file. I'd like to be able to do this with no manual interaction.

Perhaps you could modularize your script so that users could invoke only the parts of the script that they need? That way, I could get what I'm asking for, omit the extraneous stuff i'm not interested in, and i'd think this would make it easier for you add / remove functionality to your script without having to do major code revisions?

I'd do this myself, but my scripting skills are remedial at best. Thanks in advance for any help you can provide.

Share this post


Link to post
Share on other sites
GSH, thanks for all your help on this. I think it is a pretty neat and very useful script now.

I have just incorporated it into my automated install of Windows XP.

Thank you for the idea I hope you like what it produces now.

It also GSM and not GSH :D

I appreciate the significant effort you've put into this tool, but maybe I could ask for a bit more? Let me explain.

I am developing a hardware agnostic image for use in the corp environment. We have a lot of different flavors of hardware, and it would be very useful to have a script like this that could be executed from cmdlines / guirunonce during minisetup or first boot to autodetect the PC Manufacturer, model, serial #, & BIOS rev level, and then output it to winnt/system32 to overwrite the default oeminfo.ini file. I'd like to be able to do this with no manual interaction.

Perhaps you could modularize your script so that users could invoke only the parts of the script that they need? That way, I could get what I'm asking for, omit the extraneous stuff i'm not interested in, and i'd think this would make it easier for you add / remove functionality to your script without having to do major code revisions?

I'd do this myself, but my scripting skills are remedial at best. Thanks in advance for any help you can provide.

1:\ I am not sure that Wmi works at the cmdline part of a install.

2:\ This script produces a new oeminfo.ini.

If you want I could make you a custom script to produce what you want. Post what you need for the oeminfo,

I will then redo the script with what you need.

Edit

I have made some changes to the script so here is the updated SFX

Updated MkOem_V6

Edited by gunsmokingman

Share this post


Link to post
Share on other sites

... objItem.PCSystemType = 0 Then PCType = "Unspecified" ...

seems to be valid in VISTA only... (gives an errormessage in XP)

Share this post


Link to post
Share on other sites

Vista has a new way to do Oeminfo etc. It's all through the registry now...Does this sfx work for Vista as well?

EDIT: I get the same error on XP as mentioned above.

Edited by JuMz

Share this post


Link to post
Share on other sites
Vista has a new way to do Oeminfo etc. It's all through the registry now...Does this sfx work for Vista as well?

EDIT: I get the same error on XP as mentioned above.

I wrote this script on Vista, when I get a chance to install XP I will re do the script so it will work on XP.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...