Search code examples
androidwindowsusbdevice

USB PORT LOCATION


How do I get the USB port location of the device in Windows 10 without the device manager? The location for my device is Port_#0009.Hub_#0001 but I want to automate it.

I would like to run a sequence of commands to get this info.


Solution

  • While I don't know what the goal of this automation is, here's what you can do:

    Run this command in your cmd and search for your USB device:

    wmic path Win32_PnPEntity get DeviceID, Name
    

    This should be written in the following format: USB\VID_xxxx&PID_xxxx....

    Now you can use Powershell to display this value:

    Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Enum\USB\VID_xxxx&PID_xxxx\' -Name LocationInformation
    

    Here you should replace "USB\VID_xxxx&PID_xxxx..." with your current ID.

    At the end you should get your named USB port.

    If the question is meant differently, please specify it.