Sign in to follow this  
Followers 0
rich2323

iphone connected to usb?

4 posts in this topic

Is there a way to check to see if a iphone or ipad is connect to usb using Autoit?

Rich

Share this post


Link to post
Share on other sites



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

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Thank you very much works like a charm!

Rich

Share this post


Link to post
Share on other sites

Glad I could help


√-1 2^3 ∑ π, and it was delicious!

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  
Followers 0