How to Manage Device Drivers with Command Line
This topic is a how to. Please keep it as clear and simple as possible. Avoid speculative discussions as well as deep dive into underlying mechanisms or related technologies. |
Generally speaking, the best tool to manage [[device drivers]] is “Device Manager”. That is a GUI snap-in for Microsoft Management Console (MMC). You can start it by launching devmgmt.msc. But that's not an option in some specific cases, namely:
- Scripting.
- Windows Server installed in [[Server Core]] option.
In these cases, you need a command-line tool. Microsoft provides two such tools that differ both in their capabilities and availability.
Plug-and-Play (PnP) Utility (PNPUtil.exe)
Basic Features:
- List drivers - PNPUTIL.EXE -e
- Add driver.
- Install driver.
- Remove driver.
Pros:
- Included out of the box with all current Windows versions.
- Syntax complexity is medium.
Cons:
- Does not provide advanced functionality such as:
- Disable device.
- Select one specific driver for a specific device from the list of compatible drivers that are currently installed in the system.
Availability:
- Inbox with all current Windows versions.
More information:
- For a detailed description, comprehensive list of features, syntax and command-line examples please see official documentation at PnPUtil.
Device Console (DevCon.exe)
Features (also Pros):
- All device and driver management functionality that can be found in Device Management MMC including advanced functionality such as:
- Disable device.
- Select one specific driver for a specific device from the list of compatible drivers that are currently installed in the system.
Cons:
- Not available out-of-the box.
- Syntax complexity is high.
Availability:
- See [[How to Obtain the Current Version of Device Console Utility (DevCon.exe)]] for detailed instructions.
More information:
- For a detailed description, comprehensive list of features, syntax and command-line examples please see official documentation at DevCon.
Links
- For general (not command line-related) information please refer to Device Management and Installation Step-by-Step Guide: Signing and Staging Device Drivers in Windows Vista and Windows Server 2008.