Jump to content
Sign in to follow this  

Help to use WMI .put_ and .delete_() method

Recommended Posts


hello, i need to learn to menage WMI with autoit, but it's hard.

following examples of other udf, here in this forum, to menage printers by WMI i try this:

Func _Modyfing()
    Local $colItems, $objWMIService, $objItem

    $strComputer = "."
    $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2")
    $colItems = $objWMIService.Get("ActiveScriptEventConsumer").SpawnInstance_

    If IsObj($colItems) Then
        $colItems.Name = "NewName"
        SetError(1, 2, 0)

with this result in console:

"C:\Users\fasix\Desktop\WmiTools.au3" (289) : ==> The requested action with this object has failed.:
$colItems^ ERROR

and same thing appens with the .Delete_() method!

after 3 days of reading and reading and trying.... i'm in your hands

Share this post

Link to post
Share on other sites


This UDF by jguinch will tell you all you need to know.


  • Like 1

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

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