Can I determine which USB port is being used?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Can I determine which USB port is being used?

5,623件の閲覧回数
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?

ラベル(2)
タグ(1)
0 件の賞賛
3 返答(返信)

826件の閲覧回数
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

826件の閲覧回数
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 件の賞賛

826件の閲覧回数
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