


How to use the devcon command-line utility for Device Manager in Windows
Aug 03, 2025 pm 02:07 PMDownload devcon.exe from the Windows Driver Kit (WDK) and place it in a directory within your PATH. 2. Use basic commands like devcon find, status, enable, disable, remove, and rescan to manage devices via hardware IDs. 3. Apply wildcards (*, ?) to target multiple devices matching a pattern. 4. Run Command Prompt as Administrator and use hardware IDs obtained via devcon hwids or Device Manager for accurate device control. 5. Automate tasks such as driver testing or troubleshoot by disabling, enabling, or removing devices in batch scripts, ensuring system stability by avoiding critical device changes without caution, and reboot when necessary after removal operations.
The devcon
(Device Console) utility is a powerful command-line tool provided by Microsoft as part of the Windows Driver Kit (WDK). It allows you to manage devices similarly to Device Manager, but from the command line—making it ideal for scripting, automation, and troubleshooting. Here's how to use it effectively.

1. Download and Install DevCon
DevCon is not included in Windows by default. You need to get it from the Windows Driver Kit (WDK) or the older Windows SDK.
-
Download the WDK:
Go to the Microsoft WDK page and install the WDK. -
Find
devcon.exe
:
After installation, search fordevcon.exe
in the WDK directories. Common paths include:C:\Program Files (x86)\Windows Kits\10\Tools\x64\devcon.exe C:\Program Files (x86)\Windows Kits\10\Tools\x86\devcon.exe
Copy to a Convenient Location:
Movedevcon.exe
to a folder in your PATH (likeC:\Windows\System32
) or work from its current directory in Command Prompt.
? Tip: Use the version that matches your system architecture (x64 for 64-bit, x86 for 32-bit).
2. Basic Syntax and Common Commands
Open Command Prompt (as Administrator if making changes) and run:
devcon help
This shows all available commands. Here are the most useful ones:
Find Devices
Use devcon find
to list devices matching a hardware ID, class, or name.
devcon find PCI\*
Finds all devices with a PCI hardware ID.
devcon find =USB
Lists all USB devices (=
indicates device class).
List Devices with Status
devcon status =NET
Shows status of all network adapters.
devcon hwids =Display
Displays hardware IDs for all display adapters.
Enable/Disable Devices
Use hardware ID or pattern to control devices.
devcon disable "PCI\VEN_10DE&DEV_1C82"
Disables a device with the given hardware ID.
devcon enable "PCI\VEN_10DE&DEV_1C82"
Re-enables it.
? Find the correct ID using
devcon find *
ordevcon hwids *
.
Restart a Device
There's no direct "restart" command, but you can disable then enable:
devcon disable "USB\VID_0781&PID_5567" devcon enable "USB\VID_0781&PID_5567"
Remove a Device
devcon remove "PCI\VEN_8086&DEV_9D2F"
Removes the device from the system (like "Uninstall" in Device Manager).
devcon rescan
Rescans for new hardware (equivalent to "Scan for hardware changes").
3. Using Wildcards and Patterns
DevCon supports wildcards (*
and ?
) for matching multiple devices.
Examples:
devcon disable "USB\VID_045E*"
Disables all devices from vendor ID 045E (Microsoft).
devcon enable *@PCIBUS\*
Enables all devices on the PCI bus (older syntax, may vary).
? Use quotes around IDs containing special characters.
4. Practical Use Cases
Automate Driver Testing
Use DevCon in batch scripts to disable, update, and re-enable devices.
devcon disable "PCI\VEN_10EC&DEV_8168" :: Run driver update here devcon enable "PCI\VEN_10EC&DEV_8168"
Troubleshoot Problematic Devices
Identify a malfunctioning device:
devcon status "HID\VID_046D&PID_C52B"
Batch Manage Similar Devices
Disable all Bluetooth devices:
devcon disable =Bluetooth
Important Notes
- Always run Command Prompt as Administrator to modify device state.
- Be careful with hardware IDs—disabling critical devices (like display or storage) can affect system stability.
- DevCon uses hardware IDs, not friendly names. Use
devcon find
,hwids
, or check Device Manager → Properties → Details → Hardware IDs. - Some commands may require a reboot to take full effect (especially after removal).
Basically, DevCon gives you fine-grained, scriptable control over Device Manager functions. Once you have the correct hardware ID, managing devices from the command line becomes fast and repeatable.
The above is the detailed content of How to use the devcon command-line utility for Device Manager in Windows. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Django project initialization: Use command line tools to quickly create a new project. Django is a powerful Python Web framework. It provides many convenient tools and functions to help developers quickly build Web applications. Before starting a new Django project, we need to go through some simple steps to initialize the project. This article will introduce how to use command line tools to quickly create a new Django project, including specific code examples. First, make sure you have DJ installed

PE (Preinstallation Environment) is a lightweight operating system that runs before the operating system is installed. It can be used for system deployment, hard disk partitioning, data recovery, etc. This article will introduce how to install PE on CentOS and provide detailed instructions. Steps and instructions. To download the PEISO file, we need to download the PE ISO image file from the official website. Open the CentOS official website in the browser, find the PE download page, select the version that matches your hardware architecture, and click the download button. After the download is complete, Save the ISO file to your local machine. Create a PE boot disk Next, we need to write the PE ISO file to a U disk or CD

Linux is a commonly used operating system. It can not only be used for general desktop applications and server applications, but also can use some specific tools to test network performance and security. This article will introduce commonly used network testing tools and usage methods under Linux. Commonly used network testing tools 1.1 The pingping command is one of the most basic network testing tools. It can be used to detect the connectivity between the local host and the target host. By sending ICMP (InternetControlMessage

In today's digital era, information security has become a global issue. For businesses and individuals, protecting the security of servers is particularly important. As a popular operating system, Linux is widely used on many servers. This article will introduce some best practices for enhancing the security of your Linux server through command line tools. 1. Use a firewall Installing and configuring a firewall is a key step in protecting server security. Linux servers provide a powerful and highly configurable firewall tool - iptabl

In Unix or Unix-like systems, shell scripts are a common tool for automating tasks. By using shell scripts, we can avoid manual repetitive operations while also improving efficiency and accuracy. This article explains how to use shell scripts to automate tasks and provides some useful tips. Shell is a command line interactive interpreter for Unix systems. It can interpret and execute commands and scripts entered by users on the command line. Multiple command combinations can be used in the Shell to implement automated tasks, for example

Linux server security practice: using command line tools for defense Introduction: As a Linux server administrator, we must always protect the security of the server. In daily work, using command line tools to defend servers is a simple and efficient method. This article will introduce some commonly used command line tools and give corresponding code examples to help administrators strengthen server security. 1. Firewall settings Firewall is an important tool to protect the server from malicious attacks. The commonly used firewall tool in Linux systems is i

Command line tools are your defensive weapons: protect your Linux servers. With the development of the Internet, the Linux operating system is becoming more and more popular in the server field. However, Linux servers also face various network security threats. To protect your server from hackers and malware, learning to use command line tools is essential. This article will introduce some commonly used command line tools and techniques to help you protect your Linux server. Firewall Management Firewalls protect servers from unauthorized access

Command line tools: a powerful tool to deal with Linux server security challenges. With the development of the Internet, the use of Linux servers has become very common. However, the security challenges that come with it are becoming increasingly serious. As system administrators or developers, we need to find some efficient and convenient tools to help us deal with various security issues. At this time, the command line tool becomes our weapon. This article will introduce several powerful command line tools to help us solve security issues on Linux servers. nmap: port scanner
