mattw112 Posted January 7, 2009 Share Posted January 7, 2009 (edited) I used the WMIExplorer (found on this site) to get some details on WMI. I want to be able to execute a certain method. Here's the example I got from the WMIExplorer: #cs $Computer = "." $Class = "WakeUp" $Method = "WakeColl" $MC = [WmiClass]"\\$Computer\ROOT\N1E\WakeUp:$Class" $InParams = $mc.psbase.GetMethodParameters($Method) $InParams.sInArg = [string] "Calling WakeUp. : WakeColl with Parameters :" $inparams.PSBase.properties | select name,Value | format-Table $R = $mc.PSBase.InvokeMethod($Method, $inParams, $Null) "Result :" $R | Format-list #ce Not sure how to translate that into something I can use in AutoIt? Below is my try, but it is not working. $SMSID="C0100046" $objWMIService = ObjGet("winmgmts:\\.\root\N1E\WakeUp:WakeUp") $objinParams = $objWMIService.psbase.GetMethodParameters("WakeColl") $objinParams.sInArg = [string] $objinParams.PSBase.properties $objOutParams = $objWMIService.ExecMethod("WakeUp", $objinParams, $SMSID) $ReturnValue = $objOutParams.ReturnValue MsgBox(0, "TEST", $ReturnValue) Any ideas? Thanks, Terry Edited January 7, 2009 by mattw112 Link to comment Share on other sites More sharing options...
Pain Posted January 8, 2009 Share Posted January 8, 2009 Use Scriptomatic for AutoIt when you are working with WMI. 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