How to Manage Device Drivers with Command Line

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.

(what is this box?)

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 options in some specific cases, namely:

  1. Scripting
  2. 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 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 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:

More information:

  • For a detailed description, comprehensive list of features, syntax and command-line examples please see official documentation at DevCon.

Links

Leave a Comment
  • Please add 7 and 3 and type the answer here:
  • Post
Wiki - Revision Comment List(Revision Comment)
Sort by: Published Date | Most Recent | Most Useful
Comments
  • Rich Prescott edited Revision 11. Comment: Formatting and spellcheck

  • Tony Soper_MSFT edited Revision 5. Comment: Added lib link and one function/param

Page 1 of 1 (2 items)
Wikis - Comment List
Sort by: Published Date | Most Recent | Most Useful
Posting comments is temporarily disabled until 10:00am PST on Saturday, December 14th. Thank you for your patience.
Comments
  • Tony Soper_MSFT edited Revision 5. Comment: Added lib link and one function/param

  • Rich Prescott edited Revision 11. Comment: Formatting and spellcheck

Page 1 of 1 (2 items)