Fasix Posted September 27, 2016 Share Posted September 27, 2016 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.CreatorSID ;$colItems.KillTimeout ;$colItems.MachineName ;$colItems.MaximumQueueSize $colItems.Name = "NewName" ;$colItems.ScriptFilename ;$colItems.ScriptingEngine ;$colItems.ScriptText $colItems.Put_ MsgBox(0,'','Done') Else SetError(1, 2, 0) EndIf EndFunc with this result in console: "C:\Users\fasix\Desktop\WmiTools.au3" (289) : ==> The requested action with this object has failed.: $colItems.Put_ $colItems^ ERROR and same thing appens with the .Delete_() method! after 3 days of reading and reading and trying.... i'm in your hands Link to comment Share on other sites More sharing options...
kylomas Posted September 27, 2016 Share Posted September 27, 2016 Fasix, This UDF by jguinch will tell you all you need to know. kylomas meoit 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now