Can I determine which USB port is being used?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can I determine which USB port is being used?

5,542 Views
JamesJukkola
Contributor I

If I connect a USB flash drive to either USBH1 or USBOTG, it shows up in Windows (WEC7) as a folder named "Hard Disk".  Is there a way for an application to determine which USB port "Hard Disk" is using?

Labels (2)
Tags (1)
0 Kudos
3 Replies

745 Views
ChrisWilliamson
Contributor III

Hi James,

In Windows 7, you can run Device Manager and select the Mass Storage device in the USB Controllers section and look at the Properties/Detail/Location to get something like Port_#0003.Hub_#0004.

I have worked with code that crawls through the registry and makes all kinds of undocumented Windows APIs to link a drive letter to a USB ID since Windows 98 days. Windows 7 was the first OS to at least show the location in Device Manager. Maybe there is a better way these day, but historically it is has been very difficult for an application to discern which USB port the device was running on.


- Chris

745 Views
JamesJukkola
Contributor I

Hi Chris,

I want to do this in Windows Embedded Compact 7.  There is something called a Device Manager, but it does not have a user interface like the one in standard Windows 7.  I'm not sure what information I can get from it in my software.

James

0 Kudos

745 Views
ChrisWilliamson
Contributor III

Hi James,

I kind of figured you were talking about firmware, but wasn't sure. I can't say at all about WinCE myself, but I would suggest asking in a Microsoft forum maybe. Sorry I couldn't help, but would be great to know if you find a solution.

- Chris