Jump to content
Sign in to follow this  
duncanchaos

How do you input data to a WMI call?

Recommended Posts

duncanchaos

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

Share this post


Link to post
Share on other sites
FireFox

Hi,

Something like this I guess :

$objItem.SetBiosSetting($strInParamValue, $strReturn)
Br, FireFox.

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
JLogan3o13

Something like this:

$strInParamValue = ""
$strReturn = ""

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

Well hell - too slow :)

Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
FireFox

I'm not going to be defeated again  :pirate:

  • Like 1

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
duncanchaos

Thanks guys. I spent too long searching the forum for this and you guys nailed it in 10 minutes. I have tested and your syntax works.

I really appreciate the info!

JD Duncan

Senior Systems Engineer

Toshiba America Information Systems

Share this post


Link to post
Share on other sites
JLogan3o13

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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
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
Sign in to follow this  

×