MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: WMI Sample Query[Next]: Microsoft WMI Object Queries
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Tips and Tricks->Tools->WMI (Windows Management Instrumentation)->DELL's OMCI WMI Provider

DELL's OMCI WMI Provider

I could not find any documentation on DELLs site but if you search hard enough (I suggest on "DellOMCI") then you should find some examples. These should help:

Even using the DELL samples plus some other rare examples I managed to find I could not get it working consistently. The update would look like it worked and subsequent queries returned the new values but on booting and entering the BIOS settings screen some had updated but not all!

I have not had problems with this code:

'--- Init -------------------------------------------------------------------
on error resume next
const wbemFlagReturnImmediately = &h10
const wbemFlagForwardOnly       = &h20
const OnComputer                = "."
const WmiNameSpace              = "\root\DellOMCI"
const Dell_AutoOn_EveryDay_OptiPlexGx150  = 4             '??May vary between models?
const Dell_AutoOn_EveryDay                = 3             '??
const Dell_AutoOn_WeekDays                = 4             '??

'--- Open WMI ---------------------------------------------------------------
set oWMI = GetObject("winmgmts:\\" & OnComputer & WmiNameSpace)

'--- Get access to wanted class objects -------------------------------------
set oSettings = oWMI.ExecQuery("SELECT * FROM Dell_SMBIOSsettings", "WQL", wbemFlagReturnImmediately + wbemFlagForwardOnly)

'--- Loop though each matching object (for this class expect EXACTLY 1) -----
for each oSetting In oSettings
    '--- Dump values before change ------------------------------------------
    DumpAutoStartSettings oSetting, "BEFORE UPDATE"

    '--- Make the changes ---------------------------------------------------
    oSetting.AutoOn        = Dell_AutoOn_EveryDay_OPtiPlexGx150
    oSetting.AutoOnHour    = 6      '6:15am
    oSetting.AutoOnMinute  = 15     '6:15am
    oSetting.Put_                   'Don't forget this!

    '--- Dump values after change -------------------------------------------
    DumpAutoStartSettings oSetting, "AFTER UPDATE"
next

'--- Finished ---------------------------------------------------------------
set oSetting   = Nothing
set oSettings  = Nothing
set oWMI       = Nothing
wscript.quit 0


'============================================================================
sub DumpAutoStartSettings(ByRef oObject, Title)
'============================================================================
    say Title
    say string(len(Title), "~")
    say "AutoOn      : " & oSetting.AutoOn
    say "AutoOnHour  : " & oSetting.AutoOnHour
    say "AutoOnMinute: " & oSetting.AutoOnMinute
end sub


'============================================================================
sub Say(What)
'============================================================================
    wscript.echo What
end sub


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: WMI Sample Query[Next]: Microsoft WMI Object Queries


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.