How to List All Connected USB Devices Using CMD Command in Windows 10: Step-by-Step Guide

TutorialPedia Team

Date Updated

USB (Universal Serial Bus) devices are integral to modern computing, connecting everything from flash drives and keyboards to printers and external hard drives. Whether you're troubleshooting a non-functional device, auditing connected hardware for security, or simply curious about what's plugged into your PC, knowing how to list all USB devices using the command line can save time and effort.

While Windows' graphical tools like Device Manager work well, command-line tools offer a faster, scriptable way to retrieve this information—ideal for power users, system administrators, or anyone who prefers command-line efficiency. In this guide, we'll walk you through multiple reliable methods to list connected USB devices on Windows 10 and Windows 11, including PowerShell (the recommended modern approach), PnPUtil, and legacy tools like WMIC.

Table of Contents#

  1. Why Use Command Line for Listing USB Devices?
  2. Prerequisites
  3. Step-by-Step Guide to List USB Devices via Command Line
  4. Alternative Methods (Beyond Command Line)
  5. Troubleshooting Common Issues
  6. Conclusion
  7. References

Why Use Command Line for Listing USB Devices?#

  • Speed: Command-line commands execute instantly, avoiding the need to navigate through multiple GUI menus.
  • Scriptability: Commands can be automated (e.g., in batch files or PowerShell scripts) for regular device audits.
  • Remote Access: Command-line tools work over remote desktop or SSH, making them useful for managing headless systems.
  • Detail: Tools like PowerShell and PnPUtil provide granular device data (e.g., hardware IDs, status, driver information) not always visible in GUI tools.

Prerequisites#

Before starting, ensure you have:

  • A Windows 10 or Windows 11 PC.
  • Basic familiarity with Command Prompt or PowerShell (e.g., opening the terminal, running commands).
  • Administrator privileges (recommended for full access to device information; some commands may fail with standard user rights).
  • Internet access (only if using Method 4, to download the Windows Driver Kit for DevCon).

Step-by-Step Guide to List USB Devices via Command Line#

PowerShell is Microsoft's modern command-line shell and scripting language. It's included with Windows 10 and 11 and is the recommended approach for querying USB devices. Unlike WMIC (which is deprecated), PowerShell is actively maintained and receives regular updates.

Step 1: Open PowerShell#

  • Press Win + X and select Windows PowerShell (Admin) or Terminal (Admin).
  • Alternatively, press Win + R, type powershell, and press Enter.

Step 2: List All Connected USB Devices#

To list all currently connected USB devices, run:

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

What this does:

  • Get-PnpDevice: Retrieves all Plug and Play devices.
  • -PresentOnly: Filters to only show devices currently connected to the system.
  • Where-Object { $_.InstanceId -match '^USB' }: Filters for devices whose instance ID starts with "USB".

Step 3: Get More Detailed Information#

For additional details like manufacturer and device description:

Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | Select-Object Status, Class, FriendlyName, InstanceId | Format-Table -AutoSize

Example Output#

Status Class  FriendlyName                 InstanceId
------ -----  ------------                 ----------
OK     USB    USB Composite Device         USB\VID_05AC&PID_12A8\0000000000000000
OK     USB    USB Root Hub (xHCI)          USB\ROOT_HUB30\4&1A2B3C4D&0&0
OK     USB    USB Input Device             USB\VID_046D&PID_C534\5&2E3F4A5B&0&1

Tip: To export results to a CSV file for further analysis:

Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' } | Export-Csv -Path "USBDevices.csv" -NoTypeInformation

Method 2: Using PnPUtil (Built-in, Modern)#

PnPUtil is a built-in Windows command-line tool for managing devices and drivers. It ships with every Windows release and is Microsoft's recommended replacement for DevCon. Unlike DevCon, PnPUtil doesn't require downloading additional software.

Step 1: Open Command Prompt as Administrator#

  • Press Win + R, type cmd, then press Ctrl + Shift + Enter to run as administrator.
  • Alternatively, search for "Command Prompt" in the Start Menu, right-click it, and select Run as administrator.

Step 2: List All Connected Devices#

To enumerate all connected devices:

pnputil /enum-devices /connected

Step 3: Filter for USB Devices#

To list only USB devices with their device IDs:

pnputil /enum-devices /connected /class USB

Example Output#

Instance ID:                USB\VID_05AC&PID_12A8\0000000000000000
Device Description:         USB Composite Device
Class Name:                 USB
Manufacturer:               Apple Inc.
Status:                     Started

Tip: Use pnputil /enum-devices /deviceids to see hardware IDs, which can be useful for driver troubleshooting.

Method 3: Using WMIC (Legacy, Deprecated)#

⚠️ Important: WMIC is deprecated and has been removed in Windows 11 version 25H2 (released in 2025). It is disabled by default in Windows 11 version 24H2. For Windows 10 users, WMIC still works but will be removed in a future update. Use PowerShell or PnPUtil instead.

WMIC (Windows Management Instrumentation Command-line) is a legacy built-in Windows tool that queries system information via the WMI interface. It was the traditional method for listing USB devices but is now superseded by PowerShell.

Step 1: Open Command Prompt#

  • Press Win + R to open the Run dialog.
  • Type cmd and press Enter to launch CMD with standard user rights.
  • Optional: For full access, right-click Command Prompt in the Start Menu and select Run as administrator.

Step 2: Run the Basic WMIC Command#

To list all USB devices with their names, enter:

wmic path win32_pnpentity where "caption like '%USB%'" get caption

What this does:

  • wmic: Invokes the WMIC tool.
  • path win32_pnpentity: Specifies the WMI class for Plug-and-Play (PnP) devices (all hardware connected to the system).
  • where "caption like '%USB%'": Filters results to include only devices with "USB" in their name (caption).
  • get caption: Retrieves the human-readable device name.

Step 3: View Detailed USB Device Information#

For more details (e.g., hardware ID, status, manufacturer), use:

wmic path win32_pnpentity where "caption like '%USB%'" get caption, deviceid, status, manufacturer

Output Explanation:

  • Caption: Device name (e.g., "USB Composite Device", "USB Root Hub (xHCI)").
  • DeviceID: Unique hardware ID (e.g., "USB\VID_0480&PID_A200\5&1234567&0&1").
  • Status: Device status (e.g., "OK", "Error", "Degraded").
  • Manufacturer: Device manufacturer (e.g., "Microsoft", "Intel").

Example Output#

Caption                                   DeviceID                                       Status  Manufacturer
USB Composite Device                      USB\VID_05AC&PID_12A8\0000000000000000        OK      Apple Inc.
USB Root Hub (xHCI)                       USB\ROOT_HUB30\4&1A2B3C4D&0&0                 OK      Intel
USB Input Device                          USB\VID_046D&PID_C534\5&2E3F4A5B&0&1           OK      Logitech

PowerShell Equivalent (recommended):

Get-CimInstance -ClassName Win32_PnPEntity | Where-Object { $_.Caption -match 'USB' } | Select-Object Caption, DeviceID, Status, Manufacturer

Method 4: Using DevCon (Advanced, Requires WDK)#

DevCon (Device Console) is a powerful command-line tool for managing devices, included in Microsoft's Windows Driver Kit (WDK). It provides low-level device control and can list USB devices with more granularity than WMIC.

Note: Microsoft now recommends using PnPUtil instead of DevCon for new projects. PnPUtil ships with every Windows release and uses more reliable and secure APIs. DevCon is primarily intended for driver development and testing.

Step 1: Download DevCon#

DevCon is not preinstalled on Windows. To get it:

  1. Download the Windows Driver Kit (WDK) (select "Windows Driver Kit" during installation).
  2. After installation, DevCon is typically located at:
    • 64-bit: C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon.exe
    • 32-bit: C:\Program Files (x86)\Windows Kits\10\Tools\x86\devcon.exe
  3. Optional: Add DevCon to your system PATH for easy access (search "Edit the system environment variables" to configure PATH).

Step 2: Run DevCon to List USB Devices#

  • Open CMD (as administrator).
  • Navigate to the DevCon directory (e.g., cd C:\Program Files (x86)\Windows Kits\10\Tools\x64).
  • Run the following command to find all USB devices:
    devcon find *usb*

Example Output#

USB\VID_05AC&PID_12A8\0000000000000000                : USB Composite Device
USB\ROOT_HUB30\4&1A2B3C4D&0&0                         : USB Root Hub (xHCI)
ACPI\PNP0A08\0                                        : PCI Express Root Complex
... (other USB-related devices)

Tip: Use devcon status *usb* to check the status of USB devices (e.g., "Running", "Disabled").

Bonus: List USB Storage Devices with Diskpart#

If you only need to list USB storage devices (e.g., flash drives, external HDDs), use diskpart, a built-in tool for managing disks.

Step 1: Launch Diskpart#

  • Open CMD (as administrator).
  • Type diskpart and press Enter to launch the disk management tool.

Step 2: List USB Storage Devices#

In the Diskpart terminal, run:

list disk

Output Explanation:

  • Disks are labeled as "Disk 0", "Disk 1", etc.
  • USB storage devices are marked as Removable under the "Status" column.

Example Output:

  Disk ###  Status         Size     Free     Dyn  Gpt
  --------  -------------  -------  -------  ---  ---
  Disk 0    Online          476 GB    10 GB        *
  Disk 1    Removable       14 GB     0 B           (This is a USB flash drive)

Alternative Methods (Beyond Command Line)#

While this guide focuses on command-line tools, here are quick alternatives:

Device Manager (GUI)#

  • Press Win + X and select Device Manager.
  • Expand the Universal Serial Bus controllers node to view USB hubs and devices.
  • Note: Hidden devices (e.g., disconnected but previously installed) can be viewed via View > Show hidden devices.

USBDeview (Third-Party Tool)#

USBDeview by NirSoft is a free utility that shows comprehensive information about all USB devices, including connection history, vendor details, and power consumption. It marks currently active devices in green for easy identification.

Troubleshooting Common Issues#

Issue 1: "wmic is not recognized as an internal or external command"#

  • Cause: WMIC is disabled or removed in Windows 11 version 24H2 and later.
  • Fix: Use PowerShell instead (see Method 1). Run:
    Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' }

Issue 2: Commands Don't Show All Devices#

  • Cause: Outdated drivers, disabled devices, or insufficient permissions.
  • Fix:
    • Run Command Prompt or PowerShell as administrator.
    • Update USB drivers via Device Manager (right-click device > Update driver).
    • Check for hidden devices (in Device Manager: View > Show hidden devices).

Issue 3: "DevCon is not recognized" Error#

  • Cause: DevCon is not in your system PATH, or the tool was not installed correctly.
  • Fix:
    • Specify the full path to DevCon (e.g., C:\Tools\devcon.exe find *usb*).
    • Consider using PnPUtil instead (see Method 2), which is built into Windows.

Issue 4: USB Storage Not Showing in Diskpart#

  • Cause: Faulty USB port, damaged cable, or uninitialized storage.
  • Fix:
    • Try a different USB port/cable.
    • In Diskpart, run rescan to refresh disk list:
      rescan

Conclusion#

Listing USB devices via command line is a fast and flexible way to manage your system's hardware. For most users on Windows 10 and 11, PowerShell is the best starting point—it's built-in, actively maintained, and provides comprehensive device information. For users who prefer CMD, PnPUtil is the modern built-in alternative that replaces DevCon.

Legacy tools like WMIC still work on Windows 10 but are deprecated and removed in newer Windows 11 releases. DevCon remains useful for driver developers but requires downloading the Windows Driver Kit.

By mastering these commands, you can quickly audit devices, troubleshoot issues, or automate hardware checks—all without leaving the command line.

References#