- PnPUtil allows you to export, install and remove drivers from the console.
- Filters by class, bus and IDs facilitate device auditing and diagnostics.
- Advanced options list drivers, interfaces, classes and the device tree.
If you've ever found yourself reinstalling Windows or preparing multiple computers, you know that the driver issue can be a real headache. Knowing PnPUtil well allows you to create backups, install, uninstall, audit and even reboot devices from the command line. commands quickly and safely with Windows native tools.
In this complete guide you will find essential and advanced information to work with PnPUtil: from exporting all system drivers to a folder, to listing devices with problems, filter by classes or buses, and manage OEM controllers. Everything explained step by step, with practical examples and commands ready to copy and paste.
What is PnPUtil and where is it?
PnPUtil (PnPUtil.exe) is the command-line utility for managing Plug and Play drivers and devices. It is included in all versions of Windows since Vista and is located at % Windir% \ system32 (for example, C:\Windows\System32).
To use it, open a Symbol of the system o PowerShell as an administrator. The general syntax shows all the operations available in modern versions of Windows: add, delete, export, list, enable, disable, restart, and remove.
PNPUTIL | /enum-devicetree |
/disable-device <...> | /enable-device <...> | /restart-device <...> |
/remove-device <...> | /scan-devices | /enum-classes |
/enum-interfaces | /enum-containers | /?]
A quick tip: run the help first with PNPUTIL /? to confirm the options supported by your version of Windows, as some brands arrived in Windows 10 1607, 1903, 2004 and others in Windows 11 (21H2, 22H2 and 23H2).
The DriverStore folder and why it matters
Windows saves drivers in the driver store path: C:\Windows\System32\DriverStore. Drivers in use coexist with old packages that may not be necessary and are taking up space.
Before cleaning anything up, it's a good idea to list and export what you have. That way, if you delete any packages you need later, you can restore it without drama from your backup.
Export drivers with PnPUtil
Exporting driver copies is the foundation of any migration or reinstallation. You can export a specific or all OEM (third-party) packages from the depot to a destination folder. Make sure the destination folder exists before running the command to export the package. avoid route errors.
pnputil /export-driver oem6.inf .
pnputil /export-driver * C:\DriverBackup
The option /export-driver It is available since Windows 10, version 1607. It is ideal to create the folder on an external drive or network (for example, E:\Drivers) and launch the bulk export with the asterisk.
You can also do this with PowerShell if you prefer: Export-WindowsDriver -Online -Destination 'C:\DestinationPath'. This alternative extracts the drivers present in the online system and deposits them in the folder indicated with a clear structure by supplier.
List driver packages (OEM)
To inspect what is installed in the driver store (or view all installed drivers), uses /enum-driversYou can filter by class or display files from each package if you need to drill down.
pnputil /enum-drivers
pnputil /enum-drivers /class 'System'
pnputil /enum-drivers /files
Class markings arrived in Windows 11 21H2 and the option / files to view associated files was introduced in Windows 11 22H2. This makes it easier to identify which packages are third-party and which ones deserve cleaning.
Add and install drivers
When you need to integrate drivers into the warehouse (and, if applicable, install them on hardware coincident) resorts to /add-driver. It works for both a specific INF and wildcard patterns.
pnputil /add-driver X:\driver.inf
pnputil /add-driver C:\OEM\*.inf
pnputil /add-driver device.inf /install
The full syntax supports useful tags such as /subdirs to traverse subfolders, /install to apply to matching devices and /reboot if a restart is required to complete the operation.
PNPUTIL /add-driver <filename.inf | *.inf>
This command is available since Windows 10 1607. When you deploy drivers in bulk from a repository (for example, on a NAS with multiple folders per model), /subdirs y /install They save you a lot of time.
Remove drivers from the warehouse
To remove a package from the DriverStore, use /delete-driver. You can uninstall it from devices that use it with /uninstall and force delete even if it is in use with / force (extreme caution).
pnputil /delete-driver oem0.inf
pnputil /delete-driver oem1.inf /force
PNPUTIL /delete-driver <oem#.inf>
These options are present since Windows 10 1607. Force and restart may be necessary in environments where a driver is blocked, but remember that may affect stability if the device is critical.
Manage devices: disable, enable, restart, and remove
PnPUtil not only handles packages, it also operates directly on devices. Starting with Windows 10 2004, you can to disable, enable, Reiniciar o remove hardware filtering by instance, ID, class or bus.
Disable devices
Disable by instance ID, by supported hardware, by class, or by bus. Filter combinations are useful in deployments and diagnostics. problematic devices.
pnputil /disable-device "USB\VID_045E&PID_00DB\6&870CE29&0&1"
pnputil /disable-device /deviceid "USB\Class_03"
pnputil /disable-device /class "USB" /bus "PCI"
PNPUTIL /disable-device
In Windows 11 22H2, filters by class and bus arrived, and the brand / force to disable devices even if they are critical. Use it with care because you can leave essential services inactive.
Enable devices
The reverse process is just as simple and supports the same filters by class and bus (Windows 11 22H2). Enabling by ID or by class speeds up the commissioning of devices.
pnputil /enable-device "USB\VID_045E&PID_00DB\6&870CE29&0&1"
pnputil /enable-device /deviceid "USB\Class_03"
pnputil /enable-device /class "USB" /bus "PCI"
PNPUTIL /enable-device
Reboot devices
Very useful after updating drivers. Reboots a specific device, all devices that match an ID, or filters by class and bus, keeping control of maintenance actions without rebooting the entire system.
pnputil /restart-device "USB\VID_045E&PID_00DB\6&870CE29&0&1"
pnputil /restart-device /deviceid "USB\Class_03"
pnputil /restart-device /class "USB" /bus "PCI"
PNPUTIL /restart-device
Remove devices
Try removing devices from the system. You can remove an entire subtree (including children) and force the operation if the device is critical, which is useful when resolving device conflicts. persistent hardware.
pnputil /remove-device "USB\VID_045E&PID_00DB\6&870CE29&0&1"
pnputil /remove-device /deviceid "USB\Class_03"
pnputil /remove-device /class "USB" /bus "PCI"
PNPUTIL /remove-device
The brand /subtree and optional restart are available since Windows 10 2004; filters by class/bus and the / force arrived in Windows 11 22H2, expanding the granular control.
Check for hardware changes
Scans the system for hardware changes synchronously or asynchronously. Note that administrator privileges are required to run this command.
pnputil /scan-devices
/scan-devices
If you provide /instanceid, the analysis will be limited to that device subtree. With /async runs in the background, useful in concurrent work environments.
List devices and detect problems
The command /enum-devices It offers a detailed inventory. You can filter by connected or disconnected, class, problem, bus, and display relationships, services, stacks, drivers, interfaces, properties, or resources.
pnputil /enum-devices
pnputil /enum-devices /connected
pnputil /enum-devices /instanceid "ROOT\SYSTEM\0000"
pnputil /enum-devices /class "Display"
pnputil /enum-devices /problem 28
pnputil /enum-devices /problem /deviceids
pnputil /enum-devices /deviceid "USB\Class_03"
pnputil /enum-devices /bus "PCI"
The full syntax shows the range of filters and rich outputs. Very useful for auditing and documenting a system. forensic and repeatable.
PNPUTIL /enum-devices ] ]
The flags were introduced in a phased manner: connected/classes/issues since Windows 10 1903; /drivers in 2004; and in Windows 11 21H2/22H2 came bus, deviceids, services, stack, interfaces, properties and resources for a 360º vision.
Device Tree: Hierarchical View
Since Windows 11 23H2, /enum-devicetree allows you to list the device tree from a specific root and add detailed layers such as services, stack, drivers or interfaces.
pnputil /enum-devicetree
pnputil /enum-devicetree "ROOT\SYSTEM\0000"
pnputil /enum-devicetree ROOT\SYSTEM\0000 /drivers
pnputil /enum-devicetree /connected /interfaces
pnputil /enum-devicetree /stack /interfaces /drivers /services
The filters /connected, /services, /stack, /drivers e / interfaces They facilitate much more visual diagnostics of hardware and software topology without leaving the terminal.
List interfaces, classes, and containers
To view device interfaces by GUID, enabled or disabled, use /enum-interfaces. Since Windows 11 22H2, the brand /properties shows all its properties.
pnputil /enum-interfaces /enabled
pnputil /enum-interfaces /class "{884b96c3-56ef-11d1-bc8c-00a0c91405dd}"
PNPUTIL /enum-interfaces
If what you need is to review device classes, /enum-classes list all and can filter by name or GUID. The brand /services adds class services for correlate dependencies.
pnputil /enum-classes
pnputil /enum-classes /class "Display"
PNPUTIL /enum-classes
Lastly, /enum-containers (Windows 11 23H2) Works with device containers: filters by ID, status (connected/disconnected), problems, and allows you to list devices and export to different formats.
pnputil /enum-containers
pnputil /enum-containers /containerid "{00000000-0000-0000-ffff-ffffffffffff}"
pnputil /enum-containers /connected /devices
pnputil /enum-containers /disconnected /devices /format xml /output-file disconnecteddevices.xml
PNPUTIL /enum-containers ]
The exit in TXT, XML or CSV allows you to integrate inventories with external tools, reports or automation scripts without additional effort.
Mapping legacy commands
If you're coming from older versions, historical shortcuts are still supported. Although they work, Microsoft recommends the current modern syntax. clarity and compatibility.
-a <filename.inf> ==> /add-driver <filename.inf>
-d <oem#.inf> ==> /delete-driver <oem#.inf>
-e ==> /enum-drivers
Migrating your scripts to the new syntax will avoid surprises in future versions of Windows and will maintain a stronger automation foundation.
Practical examples of copying and restoring
Let's start with the basics: creating the backup. Open a privileged terminal and navigate to where you want to save the drivers. It's a good idea to use a simple path, for example, E:\Drivers on a USB.
E:
mkdir Drivers
cd Drivers
pnputil /export-driver * ./
The system will export all packages to the current folder. This approach is useful before forma tear or to replicate drivers on computers of the same model, minimizing reinstallation times.
With the backup Done, there are two ways to restore. One is manual: open the Device administrator, right-click on the hardware, "Update driver," and then "Browse my computer for driver software." Select the backup folder and let Windows detect the appropriate INF.
The other is automated with PnPUtil. If you saved drivers organized by folder, you can install them all in one go with wildcards and subdirectories, which speeds things up a lot. repetitive deployments.
pnputil /add-driver 'E:\Drivers\*.inf' /subdirs /install /reboot
Remember to save your work before running the command with /reboot. If any driver installation requires it, the computer will restart to complete the process correctly.
More useful ready-to-use examples
To list only enabled interfaces (useful before disabling something sensitive) you can run this command and then apply filters by class if you need to, thus preserving the visibility of the environment.
pnputil /enum-interfaces /enabled
To quickly see device issues (e.g., code 28, driver not installed), combine /problem with hardware and compatible ID output and locates exactly what is missing and where.
pnputil /enum-devices /problem /deviceids
If you want to explore only the connected hardware, restrict yourself with /connected (very useful in portable with extra bases or peripherals) to focus the diagnosis on what is active.
pnputil /enum-devices /connected
And for a hierarchical view with all the meat (effective stack, services, controllers and interfaces), launch the tree with all the detail layers, ideal for advanced incident resolution.
pnputil /enum-devicetree /stack /interfaces /drivers /services
Good practices and important notes
- Run PnPUtil whenever possible in an elevated console. Several operations (e.g., /scan-devices) require administrator privileges and will fail silently without them.
- Before deleting packages with /delete-driver, export your copy and validate which devices use it. You'll avoid leaving hardware unsupported due to excessive enthusiasm for cleaning.
- If you're restoring drivers on another computer, try to use the same model and a similar Windows version. Changing the edition/architecture may cause some INF files to not apply. platform incompatibilities.
- Don't rely on third-party utilities for basic backups: with PnPUtil and Export-WindowsDriver you have a clean, adware-free, and self-controlled solution, improving performance. security and control.
- Document your commands: Many brands have been arriving in waves (Windows 10 1607/1903/2004; Windows 11 21H2/22H2/23H2). Keeping an internal cheat sheet saves you time when managing heterogeneous parks.
Mastering PnPUtil gives you fine-grained control over drivers and devices with zero external dependencies: export your entire store, audit by classes and buses, mass install from folders with /subdirs, removes obsolete packages, and diagnoses the hardware tree in detail. With a couple of well-learned commands, driver maintenance goes from being a hassle to a fast, safe, and repeatable task.
Passionate writer about the world of bytes and technology in general. I love sharing my knowledge through writing, and that's what I'll do on this blog, show you all the most interesting things about gadgets, software, hardware, tech trends, and more. My goal is to help you navigate the digital world in a simple and entertaining way.
