Jump to content

How do you input data to a WMI call?


Recommended Posts

I am a System Engineer with Toshiba and we are implementing the ability to change our BIOS settings via WMI.on some of our business class laptop models.  I have the full documentation on what fields can be modified and have plenty of VBS and Powershell sample code that is working.  I am very experienced with AutoIT and would like to be able to use AutoIT do handle these tasks.

Using AutoIT the WMI queries are working without issue but AutoIT does not seem to be able to handle the syntax required to input data to a WMI field.  Here is a snip of the VBS code to change a setting via WMI:

For Each objItem in colItems
      objItem.SetBiosSetting strInParamValue, strReturn
Next
 
 
The strinParamValue variable contains the setting name and value. Here is the corresponding AutoIT code:
 
For $objItem in $colItem
    $Return = $objItem.SetBiosSetting $InParamValue
Next
 
 
AutoIT rejects the variable $inParamValue as incorrect syntax.  Does anyone know how to get AutoIT to feed the string contained in the variable back to the call so that the BIOS setting is changed?  Is AutoIT incapable of doing this?
 
Thanks
Edited by duncanchaos
Link to comment
Share on other sites

  • Moderators

Something like this:

$strInParamValue = ""
$strReturn = ""

For $obj in $colItems
$obj.SetBiosSetting($strInParamValue, $strReturn)
Next

Well hell - too slow :)

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

If you have other WMI related questions, I would highly suggest taking a look at AutoIt Script-o-Matic in the downloads section. Written by our very own Overlord Jon, it will show you the code for most everything you would like to do.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...