Device Manager Cmd — Prompt

Device Manager Cmd — Prompt

| Command | Action | |---------|--------| | pnputil /enum-devices | List all devices with details | | pnputil /enum-drivers | List all 3rd-party driver packages | | pnputil /disable-device "instance ID" | Disable a specific device | | pnputil /enable-device "instance ID" | Enable a disabled device | | pnputil /restart-device "instance ID" | Restart a device | | pnputil /remove-device "instance ID" | Uninstall a device | | pnputil /scan-devices | Scan for hardware changes | | pnputil /add-driver driver.inf | Install a driver | | pnputil /delete-driver oem0.inf | Remove a driver package | : Commands like /disable-device require the instance ID (not the friendly name). 3. How to Find a Device’s Instance ID Method A: Using pnputil /enum-devices pnputil /enum-devices > devices.txt notepad devices.txt Search for your device (e.g., "Realtek Audio"). Copy the Instance ID line. Method B: Using wmic (legacy, still works) wmic path win32_pnpentity get caption,deviceid Method C: Using PowerShell from CMD powershell "Get-PnpDevice | Where-Object $_.FriendlyName -like '*keyboard*' | Select-Object InstanceId, FriendlyName" 4. Practical Examples Example 1: Disable a faulty network adapter pnputil /disable-device "PCI\VEN_10EC&DEV_8168\4&1A2B3C4D&0&00E1" Example 2: Enable a disabled sound device pnputil /enable-device "HDAUDIO\FUNC_01&VEN_10EC&DEV_0288\5&12345678&0&0001" Example 3: Restart a non-responsive USB controller pnputil /restart-device "USB\VID_8087&PID_0024\5&2B4C6D8E&0&1" Example 4: Force a hardware rescan (like clicking "Scan for hardware changes" in GUI) pnputil /scan-devices Example 5: Uninstall a Bluetooth adapter pnputil /remove-device "BTH\MS_BTHBRB\6&2F3A4B5C&0&1" 5. Driver Management via CMD List all installed driver packages pnputil /enum-drivers Add a new driver (e.g., for a printer or GPU) pnputil /add-driver C:\Drivers\mydriver.inf /install The /install flag also installs the driver on matching devices. Remove an old driver First find its published name ( oem0.inf , oem1.inf , etc.):

start devmgmt.msc To open it on a remote computer (if you have permissions): device manager cmd prompt

pnputil /enum-drivers | findstr "oem" Then delete: | Command | Action | |---------|--------| | pnputil

devmgmt.msc /computer=\\RemotePCName Windows provides a built-in command-line tool called PnPUtil (Plug and Play Utility) to manage drivers and devices. Copy the Instance ID line

devmgmt.msc Or using the full path: