pnputilPnputil Command: Manage Drivers and Devices from the Command Line
Master the Windows pnputil command. Learn how to enumerate devices, export driver packages, install third-party drivers, and troubleshoot hardware in this complete guide.
The pnputil command (Plug and Play Utility) is a Windows command-line tool that allows administrators to manage the Driver Store, which is the internal repository where Windows caches driver packages before installation. Rather than clicking through the graphical Device Manager, IT professionals use pnputil to automate driver injection, back up installed drivers, and forcefully delete broken third-party packages.
Whether you're prepping a master image for Microsoft Endpoint Configuration Manager (MECM), troubleshooting a "Code 43" graphics card error, or mass-exporting device drivers before performing a clean Windows installation, mastering the pnputil command provides unparalleled control over hardware interactions. System administrators rely heavily on this command to ensure peripheral compatibility without manual intervention.
This comprehensive guide covers pnputil syntax, parameter usage for driver staging, practical examples for backing up your entire system's driver suite, diagnosing difficult hardware installation failures, and a detailed frequently asked questions section. By the end, you'll orchestrate hardware components directly from the terminal.
What Is the Pnputil Command?
Pnputil is an advanced Windows utility that queries and modifies the Driver Store (C:\Windows\System32\DriverStore). When a new piece of hardware is connected, Windows typically checks the store for a matching INF file. By using pnputil, administrators can proactively stage drivers into this store, ensuring that when the hardware is eventually plugged in, Windows installs it automatically, silently, and instantly.
Syntax
The syntax for the pnputil command relies on explicit action switches (like /add-driver or /enum-devices), often targeting .inf files directly.
pnputil [/enum-devices] [/enum-interfaces]
pnputil /add-driver <filename.inf> [/subdirs] [/install] [/reboot]
pnputil /delete-driver <oem#.inf> [/force]
pnputil /export-driver * <target_directory>
| Parameter | Description |
|---|---|
/add-driver | Stages a third-party driver package into the Windows Driver Store. |
/delete-driver | Removes a driver package from the store using its oem*.inf Published Name. |
/export-driver | Exports all third-party drivers (or a specific one) to a selected destination folder. |
/enum-devices | Enumerates and displays detailed properties of all hardware devices currently recognized by the system. |
/enum-drivers | Lists all third-party driver packages stored in the Driver Store. |
/subdirs | Used with /add-driver to recursively search for .inf files in subdirectories. |
/install | Used with /add-driver to immediately install the driver on matching connected devices. |
/force | Used with /delete-driver to forcefully remove a package even if devices are using it. |
Parameters / Options
Enumerating Hardware (/enum-devices)
The /enum-devices option provides a verbose output of every piece of hardware connected to the OS. It outputs critical metadata like the "Instance ID", which is required for granular MECM/Intune targeting.
Staging Drivers (/add-driver)
The /add-driver option takes a path to an INF file. By appending /subdirs, you can point pnputil to a massive unzipped folder full of drivers from Dell or Lenovo, and it will ingest every single one automatically.
Backing Up Drivers (/export-driver)
The /export-driver switch is arguably the most useful for end-users. By passing the wildcard * accompanied by a folder path, Windows will copy every single non-Microsoft driver into that directory, effectively creating a perfect backup before an OS wipe.
Examples
1. Enumerating All Third-Party Drivers
Determine exactly what non-native drivers are residing in your system store.
pnputil /enum-drivers
Output:
Microsoft PnP Utility
Published Name: oem0.inf
Original Name: prnms001.inf
Provider Name: Microsoft
Class Name: Printers
Class GUID: {4d36e979-e325-11...}
Driver Version: 06/21/2006 10.0.19041.1
Published Name: oem1.inf
Original Name: nvlddmkm.inf
Provider Name: NVIDIA
...
Explanation: Windows renames third-party drivers as oem1.inf, oem2.inf, etc., inside the store. You must use this command to find the "Published Name" before you can delete a specific driver.
2. Backing Up All Drivers
This is a critical pre-requisite before reinstalling Windows.
mkdir C:\DriversBackup
pnputil /export-driver * C:\DriversBackup
Output:
Exporting driver package: oem0.inf
Successfully exported: C:\DriversBackup\prnms001.inf
...
Total driver packages: 54
Successfully exported: 54
Explanation: Pnputil reads the wildcard * and systematically copies every OEM driver from the system cache directly to the specified folder. Keep this folder on a USB stick!
3. Injecting a Directory of Drivers
If you just downloaded a 2GB firmware/driver pack for a new server model, inject it all simultaneously.
pnputil /add-driver C:\ExtractedDrivers\*.inf /subdirs /install
Explanation: This command traverses C:\ExtractedDrivers recursively due to /subdirs. It stages every .inf it finds. The /install flag aggressively attempts to bind these staged drivers to any presently connected hardware that matches.
4. Deleting a Corrupt Driver
When a bad graphics card driver repeatedly blue-screens the PC during hardware detection, you need to nuke it from the store.
pnputil /delete-driver oem12.inf /force
Explanation: After using /enum-drivers to determine the bad NVIDIA driver is mapped to oem12.inf, this command purges it. The /force flag kills the driver even if the OS thinks a connected device still needs it.
5. Listing All Connected Devices
To query exactly what the motherboard detects on the PCIe bus or USB headers without opening Device Manager.
pnputil /enum-devices | findstr /i "Status Name"
Output:
Class Name: Net
Status: Started
Class Name: Display
Status: Started
Explanation: Using findstr helps filter the immense output of /enum-devices down to just the hardware class and whether the driver successfully "Started" the device.
Common Use Cases
- Bare-Metal OS Imaging: Injecting mass network and storage controller drivers into an offline Windows image using DISM and PnPutil so that upon the first reboot, the PC inherently understands its specialized hardware.
- Preventing Blue Screens: Purging incompatible or corrupted audio drivers via Safe Mode using
/delete-driverto stop boot loops. - Mass USB Printing: A school IT department deploying generic HP printer drivers silently across a lab. When students plug in the USB cable, the driver binds instantly without requesting admin credentials.
- Pre-Format Backups: Service desk technicians running an export script to capture a laptop's proprietary Wi-Fi and trackpad drivers to a central network share before wiping a malware-infected machine.
- Auditing Hardware: Security teams using
/enum-devicesto ensure unauthorized webcams or Bluetooth transceivers are not attached to highly secure workstations.
Tips and Best Practices
- Find the OEM Number First: Never guess when using
/delete-driver. The numberingoemX.infchanges on every PC. Always run/enum-driversfirst, log the mapping, and specify the exact target. - Run as Administrator: Modifying the Driver Store requires elevated, System-level privileges. A standard user executing
/add-driverwill be denied. - Understand /install: Staging a driver via
/add-driversimply parses it. Windows will only install it when the hardware is connected hereafter. If the hardware is already connected and lacking a driver, you must append/installto force binding immediately. - Backup Before Wiping: Always use
/export-driver *to external media when formatting obscure laptops. Vendor websites notoriously hide legacy chipset drivers that otherwise remain safely cached on the local disk.
Troubleshooting Common Issues
"PNPUTIL: Access is Denied"
Problem: The command executes but refuses to stage or delete drivers.
Solution: The DriverStore directory is owned by the SYSTEM account. Modifying it requires elevated permissions. Right-click the Command Prompt and select "Run as Administrator".
"Failed to delete driver package: One or more devices are presently installed using the specified INF"
Problem: Pnputil blocks you from removing an active driver.
Solution: Either go into Device Manager and select "Uninstall Device" first, or append the /force parameter to your pnputil command to aggressively strip the file from caching.
Driver Does Not Automatically Bind to Hardware
Problem: You staged the driver successfully, but the device remains yellow-banged in Device Manager.
Solution: Verify the hardware's exact Instance ID (using /enum-devices) precisely matches the strings contained inside the .inf text file. If the Vendor ID (VEN) or Device ID (DEV) differ even slightly, Windows will reject the binding.
Related Commands
driverquery – Detailed View
While pnputil focuses on the Driver Store, driverquery provides a highly formatted, verbose list of currently loaded .SYS files strictly actively bound to the running kernel.
dism – Prepping Offline Images
Pnputil operates on the live, running OS. dism /image:C:\offline /Add-Driver is the equivalent mechanism for injecting drivers into a WIM file or offline disk prior to boot.
devcon – Legacy Microsoft CLI
Devcon was the Windows XP era hardware manager. It is mostly deprecated and extremely complex. Pnputil fully replaces its modern staging functionality.
Frequently Asked Questions
What does the pnputil command do?
The pnputil command is the official Microsoft utility for managing the Windows Driver Store, allowing you to add, delete, export, and enumerate third-party drivers without using a GUI.
How do I use pnputil to backup drivers?
Connect a USB drive to the PC, open an Administrator prompt, and run pnputil /export-driver * D:\DriverBackup. Every non-Windows driver will copy over securely.
Does pnputil require a restart?
Staging drivers into the store does not require a restart. However, if you aggressively install a core chipset or graphics driver, the newly bound hardware device might demand a reboot to function properly.
How do I list every printer driver installed?
Run pnputil /enum-drivers | findstr /i "Printers". This will filter the massive list of third-party .inf files down to those categorically mapped to printing hardware.
Can pnputil fix "Code 43" USB errors?
Pnputil cannot directly fix hardware failure. However, you can use it to /delete-driver forcefully to guarantee a corrupted cache isn't perpetuating the issue, allowing a clean reinstall upon next plug-in.
Is pnputil available on Windows 10 Home?
Yes. It is a fundamental component of the modern Windows Driver Foundation (WDF) and is available on all modern Windows editions, including Home, Pro, and Server Core.
Do I need admin rights to use pnputil?
You can use enumeration commands like /enum-devices as a standard user, but adding or deleting .inf files actively mutates secure system directories and completely forbids non-admin usage.
Why use pnputil instead of Device Manager?
Automation. You cannot write a script to click through Device Manager. Pnputil enables SCCM, Intune, and local batch scripts to silently pre-stage hundreds of drivers onto thousands of machines simultaneously.
Will /export-driver copy Microsoft's built-in drivers?
No. Advanced inbox drivers (like the generic Microsoft Basic Display Adapter) are baked heavily into the OS image. Pnputil only exports third-party 'OEM' packages injected post-installation.
How do I install an unzipped driver folder?
Navigate to the folder containing your downloaded, unzipped .inf files. Run pnputil /add-driver *.inf /subdirs /install to ingest them all recursively and bind them instantly.
Quick Reference Card
| Command | Purpose | Example |
|---|---|---|
pnputil /enum-devices | Hardware Metadata | View connected Instance IDs |
pnputil /enum-drivers | List 3rd Party Drivers | Find oem*.inf names |
pnputil /add-driver *.inf | Stage Driver | Store driver before plugging device in |
pnputil /add-driver *.inf /install | Install Driver | Force bind available hardware |
pnputil /export-driver * C:\Backup | Backup Everything | Save drivers prior to formatting |
Summary
The pnputil command strips away the graphical overhead of Device Manager, exposing raw, direct manipulation of the Windows Driver Store. By granting administrators the power to silently stage .inf files recursively, IT teams can guarantee seamless hardware peripheral deployments without disruptive UAC prompts or manual intervention.
In this guide, we explored using /enum-drivers to catalog the opaque oem*.inf numbering system, successfully leveraging /export-driver * to rescue proprietary configurations before disk formats, and utilizing /force parameters to aggressively eradicate malfunctioning graphics drivers. We also summarized best practices for navigating Administrator restrictions.
By mastering pnputil, system builders and endpoint engineers transform unpredictable hardware provisioning into a reliable, scripted methodology. Paired with offline imaging tools like DISM, pnputil serves as the absolute final word in Windows device compatibility.