24

I would like to obtain by a command prompt a list of all USB devices connected to my computer (O.S. Windows 10). I've googled to find such a command, but all results seems useless to me or worse workless. Does anybody know how can I do that?

Thank you

Martin
  • 2,573
  • 28
  • 22
Luca
  • 243
  • 1
  • 2
  • 5

5 Answers5

32

You can use the wmic command:

wmic path CIM_LogicalDevice where "Description like 'USB%'" get /value
Cristian Ciupitu
  • 20,270
  • 7
  • 50
  • 76
Ronny D'Hoore
  • 752
  • 7
  • 9
10

With powershell, you can use the command :

Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' }

a simple short to use powershell from cmd and get result :

powershell "Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' }"
Mimouni
  • 3,564
  • 3
  • 28
  • 37
3

You could use wmic command:

wmic logicaldisk where drivetype=2 get <DeviceID, VolumeName, Description, ...>

Drivetype 2 indicates that its a removable disk.

WesternGun
  • 11,303
  • 6
  • 88
  • 157
  • 1
    you have to remove spaces around '=' to get result -> wmic logicaldisk where drivetype=2 get * – N.S Feb 20 '19 at 08:21
  • You should have in mind, that external Hard Drives have drivetype=3 (local disk) like internal hard drives. Only USB sticks have drivetype=2. – Ruik Mar 10 '21 at 13:22
0
pnputil /enum-devices /connected /class USB

This requires Windows 10 1903 or higher. List of possible flags

Martin
  • 2,573
  • 28
  • 22
-3

you can download USBview and get all the information you need. Along with the list of devices, it will also show you the configuration of each device.

Ankit Gupta
  • 580
  • 6
  • 11
  • 1
    USBview is part of the debug tools for windows. You can see how to get this program here. https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/usbview – styks Feb 11 '18 at 22:51
  • 5
    Why is this accepted and -6 without any good comments? – Barnaba Aug 28 '20 at 14:21
  • 1
    The accepted answer is not a command. Thats why I down voted. – NDEthos Apr 14 '21 at 16:49
  • 1
    if the accepted answer is not something that was wanted in the first place, then it means that the question was somewhat asked incorrectly. So i think it's better to down vote the question either. because it wanted a command but accepted a software recommendation as the answer! so the question was not asked correctly at the first place, right? – Mahmood Kiaheyrati Oct 16 '21 at 21:58