Let’s check how to use PnPUtil Driver Manager to install drivers using the command prompt on Windows 10 and Windows 11 PCs. PnPUtil is the command-line tool for adding, installing, or deleting driver packages.
PnPUtil.exe is a command line utility that you can use to manage the driver store. That lets an administrator perform the following actions on driver packages including:
- Adding a driver package to the driver store.
- Installing a driver package on the computer.
- Deleting a driver package from the driver store.
- Enumerating the driver packages that are currently in the driver store. Only driver packages that are not in-box packages are listed. An in-box driver package is one which is included in the default installation of Windows or its service pack.
Windows 10 and Windows 11 comes with an integrated PnPUtil.exe tool that allows the system administrator to easily manage the driver, update or remove the driver from the list of drivers.
Driver packages are using the INF files for installing device drivers for hardware components. A setup information (INF) file is a text file in a driver package that contains all of the information that device installation components used to install a driver package on a device.
When a physical device is deployed without a driver for a device or missing or incompatible drivers, you may experience a question mark or error inside Device Manager; here, you can check to Fix Unknown Device Drivers in Device Manager.
- Best Guide for Dell Driver Management Using SCCM
- Easily Download SCCM Driver Package for Lenovo
- Easy Steps to Download HP Driver Packs for SCCM
Where to Get PnPUtil?
PnPUtil is included in every version of Windows in the %windir%\system32
directory folder of all Windows 10 and Windows 11 installations. There isn’t a separate PnPUtil download package.
- Open a Command Prompt window (Run as administrator).
- Type
pnputil /?
to view command options.
The PnPUtil command-line installs or manages drivers from the command line. You can use this command to add driver packages, remove driver packages, and list driver packages in the store.
It is designed to manage the driver on every version of Windows devices. The following are the supported PnPUtil command-line options.
PNPUTIL [/add-driver <...> | /delete-driver <...> |
/export-driver <...> | /enum-drivers |
/enum-devices [<...>] | /enum-interfaces [<...>] |
/disable-device <...> | /enable-device <...> |
/restart-device <...> | /remove-device <...> |
/scan-devices [<...>] | /?]
Let’s see how to use the PnPUtil tool for managing driver packages –
Add Multiple Driver Packages – PnpUtil Driver Manager
To add multiple driver packages from the folders, you can use the below command line –
/add-driver <filename.inf | *.inf> [/subdirs] [/install] [/reboot]
/subdirs – traverse subdirectories for driver packages.
/install – install/update drivers on any matching devices.
/reboot – reboot system if needed to complete the operation.
For example, I have downloaded the driver package from the manufacturer site that doesn’t include an installer application (like setup.exe or install.msi) and extracted the file.
Now I want to install the all drivers part of the package bundle, and the folder structure looks like this –
To add multiple packages, you can type the command. I have used the following command from Windows 11 and Windows 10 PCs. For Example:
Note: Make sure that you adjust the paths as per your environment.
pnputil /add-driver "C:\Users\jitesh\Desktop\5420\win10\*.inf" /subdirs /install /reboot
The process started running. Importing drivers may take a long time, especially if you are importing multiple driver packages. Once the process is completed, you will see the driver package added successfully with the total count at the end.
Add Individual Driver Package
To add individual driver packages from the folders, You can use the Setup Information file (.INF) to install the driver or use the PnpUtil driver manager utility from the command line manually.
Here you will have to provide the path or name to the INF file of the driver to be installed, and you can use the below command line –
pnputil /add-driver driverfilename.inf /install
Find .INF Name for Installed Device Driver
Every installed driver has an OEM number. Let’s check how you can retrieve the INF name for the installed drivers in the system. This method only works for INF files that are installed in the system.
It’s important to check the file name if you are required to install or uninstall a particular driver installed in your system.
- To open Device Manager. Type devmgmt.msc or hdwwiz.cpl into Run, and click on OK.
- Scroll and find the driver from the lists
- Double-click or Right-click on the Driver and select Properties.
- Switch to the Details tab and from the drop-down box under the Property tab, select Inf Name.
The value should show the inf name for this driver. For example, the value may look something like oem156.inf.
To match a driver in an INF file, You need to locate the INF files from (C:\Windows\INF). Next, Double click on the selected file, and it will be opened in Notepad as follows, looking at Abstract.
You will get to know the purpose of the drivers accordingly carefully you need to proceed to perform actions.
Command Line Option
Here’s how you can also use the command line to check the OEM number of the driver you want to delete –
pnputil.exe -e or pnputil.exe -e <INF name> where -e Specifies to enumerate all third-party INF files.
You will see the list of driver packages that are already installed in the driver catalog with the details, you need to look for the driver package which you want to delete or uninstall. For Example, The OEM number is located in the published name for individual installed drivers.
Delete or Uninstall Driver Package – PnpUtil Driver Manager
Let’s see how to Delete or Uninstall Driver Using the PnPUtil driver manager utility. You can specify the Setup Information file (.INF) of the driver to be uninstalled –
pnputil /delete-driver <oem#.inf> [/uninstall] [/force] [/reboot]
Delete driver package from the driver store.
/uninstall - uninstall driver package from any devices using it.
/force - delete driver package even when it is in use by devices.
/reboot - reboot system if needed to complete the operation.
Similarly, you can use PnPUtil to perform various operations. Here, the below table provides examples of how to use the PnPUtil driver management tool.
Descriptions | Command line Syntax (Example) |
Add driver package | pnputil /add-driver x:\driver.inf |
Add multiple driver packages | pnputil /add-driver c:\oem*.inf |
Add and install driver package | pnputil /add-driver device.inf /install |
Enumerate OEM driver packages | pnputil /enum-drivers |
Delete driver package | pnputil /delete-driver oem0.inf |
Force delete driver package | pnputil /delete-driver oem1.inf /force |
Export driver package | pnputil /export-driver oem6.inf |
Export all driver packages | pnputil /export-driver * c:\backup |
Disables device specified by device instance ID | pnputil /disable-device “USB\VID_045E&PID_00DB\6&870CE29&0&1” |
Enables device specified by device instance ID | pnputil /enable-device “USB\VID_045E&PID_00DB\6&870CE29&0&1” |
Restarts device specified by device instance ID | pnputil /restart-device “USB\VID_045E&PID_00DB\6&870CE29&0&1” |
Removes device specified by device instance ID | pnputil /remove-device “USB\VID_045E&PID_00DB\6&870CE29&0&1” |
Scan the system for any device hardware changes | pnputil /scan-devices |
Enumerate only connected devices on the system | pnputil /enum-devices /connected |
Enumerate device with specific instance ID | pnputil /enum-devices /instanceid “ACPI\PNP0A08\1” |
Enumerate all devices with specific class | pnputil /enum-devices /class Display |
Enumerate all devices with specific problem code | pnputil /enum-devices /problem 28 |
Enumerate all devices with problems and display hardware/compatible IDs | pnputil /enum-devices /problem /ids |
Enumerate only enabled interfaces on the system | pnputil /enum-interfaces /enabled |
Troubleshooting
Here based on the parameters added to the command line, you can check the logs for additional information –
If the /add-driver
and /delete-driver
options were specified, check %windir%\inf\setupapi.dev.log
for more information.
If the /enable-device
and /disable-device
options were specified, set the SetupAPI log verbosity to full (0x2000ffff
) and re-attempt the operation. If it fails again, check %windir%\inf\setupapi.app.log
Thanks for a great driver management walk through of pnputil.exe.
However, to manage this from a SCCM perspective. How would you implement a solution taking advantage of pnputil ?
In case you want to create a package or application to install or update specific drivers! I think you can create a script and handle it with the utility apart from that good to use the Inbuilt mechanism to handle the driver package!
Hi Jacob, The best scenario is to use in sccm, I would say..Suppose we need to target or update individual pack drivers inside the device! We can create a package and do the deployment from SCCM.
great walkthrought but how can you install a inf file to a specific device
Hi, do you have script to run this as Task Sequence on SCCM
I have created a Task Sequence and I am getting an error after installing the drivers
Driver package added successfully. (Already exists in the system) InstallSoftware 29/08/2022 01:29 12848 (0x3230)
Published Name: oem287.inf InstallSoftware 29/08/2022 01:29 12848 (0x3230)
InstallSoftware 29/08/2022 01:29 12848 (0x3230)
Total driver packages: 190 InstallSoftware 29/08/2022 01:29 12848 (0x3230)
Added driver packages: 133 InstallSoftware 29/08/2022 01:29 12848 (0x3230)
Command line is being logged (‘OSDDoNotLogCommand’ is not set to ‘True’) InstallSoftware 29/08/2022 01:29 12848 (0x3230)
Command line pnputil /Add-Driver “C:\Drivers\*.inf” /subdirs /install /reboot returned 259 InstallSoftware 29/08/2022 01:29 12848 (0x3230)
Process completed with exit code 259 TSManager 29/08/2022 01:29 4656 (0x1230)
!——————————————————————————————–! TSManager 29/08/2022 01:29 4656 (0x1230)
Failed to run the action: Apply Drivers. Error 259 TSManager 29/08/2022 01:29 4656 (0x1230)
Not in SSL. TSManager 29/08/2022 01:29 4656 (0x1230)
Set a global environment variable _SMSTSLastActionRetCode=259 TSManager 29/08/2022 01:29 4656 (0x1230)
Set a global environment variable _SMSTSLastActionName=Apply Drivers TSManager 29/08/2022 01:29 4656 (0x1230)
Set a global environment variable _SMSTSLastActionSucceeded=false TSManager 29/08/2022 01:29 4656 (0x1230)
Clear local default environment TSManager 29/08/2022 01:29 4656 (0x1230)
Failed to run the action: Apply Drivers. Execution has been aborted TSManager 29/08/2022 01:29 4656 (0x1230)
Not in SSL. TSManager 29/08/2022 01:29 4656 (0x1230)
Failed to run the last action: Apply Drivers. Result 259. Execution of task sequence failed. TSManager 29/08/2022 01:29 4656 (0x1230)
Not in SSL. TSManager 29/08/2022 01:29 4656 (0x1230)
Reverting power plan to the initial setting after it was set to custom performance plan. TSManager 29/08/2022 01:29 4656 (0x1230)
Executing command line: PowerCfg /setactive db310065-829b-4671-9647-2261c00e86ef with options (0, 0) TSManager 29/08/2022 01:29 4656 (0x1230)
Process completed with exit code 0 TSManager 29/08/2022 01:29 4656 (0x1230)
Verified reverting power scheme to the initial setting db310065-829b-4671-9647-2261c00e86ef TSManager 29/08/2022 01:29 4656 (0x1230)
Executing command line: powercfg /delete cbd2463E-9cea-42a7-bdff-7c02f06b18c2 with options (0, 0) TSManager 29/08/2022 01:29 4656 (0x1230)
Process completed with exit code 0 TSManager 29/08/2022 01:29 4656 (0x1230)
Task Sequence Engine failed! Code: enExecutionFail TSManager 29/08/2022 01:29 4656 (0x1230)
**************************************************************************** TSManager 29/08/2022 01:29 4656 (0x1230)
Task sequence execution failed with error code 80004005 TSManager 29/08/2022 01:29 4656 (0x1230)
Cleaning Up. TSManager 29/08/2022 01:29 4656 (0x1230)
Removing Authenticator TSManager 29/08/2022 01:29 4656 (0x1230)
Cleaning up task sequence folder TSManager 29/08/2022 01:29 4656 (0x1230)
Deleting volume ID file C:\_SMSTSVolumeID.7159644d-f741-45d5-ab29-0ad8aa4771ca … TSManager 29/08/2022 01:29 4656 (0x1230)
Successfully unregistered Task Sequencing Environment COM Interface. TSManager 29/08/2022 01:29 4656 (0x1230)
Executing command line: “C:\WINDOWS\CCM\TsProgressUI.exe” /Unregister with options (0, 0) TSManager 29/08/2022 01:29 4656 (0x1230)
==========[ TsProgressUI started in process 4632 ]========== TsProgressUI 29/08/2022 01:29 7300 (0x1C84)
Command line: “C:\WINDOWS\CCM\TsProgressUI.exe” /Unregister TsProgressUI 29/08/2022 01:29 7300 (0x1C84)
Unregistering COM classes TsProgressUI 29/08/2022 01:29 7300 (0x1C84)
Unregistering class objects TsProgressUI 29/08/2022 01:29 7300 (0x1C84)
Shutdown complete. TsProgressUI 29/08/2022 01:29 7300 (0x1C84)
Process completed with exit code 0 TSManager 29/08/2022 01:29 4656 (0x1230)
Successfully unregistered Task Sequence Progress UI. TSManager 29/08/2022 01:29 4656 (0x1230)
Start to cleanup Task Sequence policy TSManager 29/08/2022 01:29 4656 (0x1230)
End Task Sequence policy cleanup TSManager 29/08/2022 01:29 4656 (0x1230)
RegQueryValueExW is unsuccessful for Software\Microsoft\SMS\Task Sequence, SMSTSEndProgram TSManager 29/08/2022 01:29 4656 (0x1230)
GetTsRegValue() is unsuccessful. 0x80070002. TSManager 29/08/2022 01:29 4656 (0x1230)
End program: TSManager 29/08/2022 01:29 4656 (0x1230)
Error executing Task Sequence Manager service. Code 0x80004005 TSManager 29/08/2022 01:29 4656 (0x1230)
Sending error status message TSManager 29/08/2022 01:29 4656 (0x1230)
Not in SSL. TSManager 29/08/2022 01:29 4656 (0x1230)
Hi,
We are using Microsoft Windows 10 Enterprise LSTB Edition.
While querying the pnputil /? I am unable to see disable-device or enable-device commands.
Your comment is requested.
Hi, Disables devices on the system. Command available starting in Windows 10 version 2004.
So here’s my issue. I’m trying to install drivers from a USB. The system is run from a pre-existing OS, all the hdd/ssd were moved over, but new MOBO, new Graphics card…literally the only things not brand new are the disk drives.
After hooking up, I can’t get the new drivers to install. Normally it would be fine, but my system can’t detect my new WAN/LAN setup so it’s stuck in airplane mode and wants me to reset my PIN but I have no internet.
I’ve tried everything I can think of but, without a computer to view the file names, i can’t seem to get it to detect the new drivers. Any ideas?