ScriptUSER Posted April 16, 2007 Share Posted April 16, 2007 I was trying to convert this Vbs script to autoit . and gettng error on " select part " can one tell my mistake $strComputer = "." $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\WMI") $colItems = $objWMIService.ExecQuery( _ "SELECT * FROM MSMouse_PortInformation",,48) ; vbs script for error line translated as above ;-------------------------------------------- ;Set colItems = objWMIService.ExecQuery( _ ; "SELECT * FROM MSMouse_PortInformation",,48) ;~--------------------------------- For $objItem in $colItems MsgBox(4096,"Active " , $objItem.Active) MsgBox(4096,"ConnectorType " , $objItem.ConnectorType) MsgBox(4096,"Buttons " , $objItem.Buttons) Next Link to comment Share on other sites More sharing options...
BigDaddyO Posted April 16, 2007 Share Posted April 16, 2007 Not totally sure what the return should be but if you take off the ,,48 it will run with no errors. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 16, 2007 Share Posted April 16, 2007 This works for me: $objWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\WMI") $colItems = $objWMIService.ExecQuery ("SELECT * FROM MSMouse_PortInformation") $n = 1 For $objItem In $colItems MsgBox(4096, "Mouse: " & $n, "Active: " & $objItem.Active & @CRLF & _ "ConnectorType: " & $objItem.ConnectorType & @CRLF & _ "Buttons: " & $objItem.Buttons) $n += 1 Next Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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