Windows 7 How to get drive letter of USB device on Win7

Discussion in 'Programming and Scripting' started by at2009, Sep 2, 2009.

  1. at2009

    at2009 New Member

    Joined:
    Sep 2, 2009
    Messages:
    8
    Likes Received:
    0
    Using WMDM I have created a small application to read portable device information, my application works fine on vista and XP but has one problem on Win7.

    Problem: I am not able to get drive letter of USB device.

    I am calling GetName of IWMDMDevice interface, on XP & VISTA this API returns device name which has a drive letter e.g.
    XP: "Removable Disk ( E: ) "
    Vista: "Removable Disk ( E: )"
    Win7: "Kingston"
    Can some one help me how to get drive letter of USB device on Win7. Thanks in advance.
    If am asking this question in wrong forum then pls do suggest me where should I post my query.
     
  2. kemical

    kemical Windows Forum Admin
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    Aug 28, 2007
    Messages:
    31,829
    Likes Received:
    1,565
  3. at2009

    at2009 New Member

    Joined:
    Sep 2, 2009
    Messages:
    8
    Likes Received:
    0
    My requirement is to get drive letter using WMDM or WPD, using GetLogicalDriveStrings and GetVolumeInformation I can get drive letter but problem is, my application uses WMDM interfaces to scan devices and read their attribute. If I use these API then in case of multiple device of same type(brand) there is no way I can map correct device to corresponding drive letter.
     

Share This Page

Loading...