rich2323 Posted January 13, 2014 Share Posted January 13, 2014 Is there a way to check to see if a iphone or ipad is connect to usb using Autoit? Rich Link to comment Share on other sites More sharing options...
Moderators Solution JLogan3o13 Posted January 13, 2014 Moderators Solution Share Posted January 13, 2014 I don't have my iPad plugged in, but this should capture devices plugged in via USB. #include <MsgBoxConstants.au3> $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $WMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") $aItems = $WMI.ExecQuery("SELECT * FROM Win32_PnPEntity", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($aItems) Then For $item In $aItems MsgBox($MB_SYSTEMMODAL, $item.Description, $item.PNPDeviceID) Next Else Msgbox($MB_SYSTEMMODAL,"WMI Output","No WMI Objects Found for class: " & "Win32_PnPEntity" ) Endif You could easily modify it like so: #include <MsgBoxConstants.au3> $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $WMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2") $aItems = $WMI.ExecQuery("SELECT * FROM Win32_PnPEntity", "WQL", $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($aItems) Then For $item In $aItems If StringInStr($item.Description, "iPad") Then ;Do Stuff EndIf Next Else Msgbox($MB_SYSTEMMODAL,"WMI Output","No WMI Objects Found for class: " & "Win32_PnPEntity" ) Endif "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
rich2323 Posted January 13, 2014 Author Share Posted January 13, 2014 Thank you very much works like a charm! Rich Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 13, 2014 Moderators Share Posted January 13, 2014 Glad I could help "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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