\\ Amazon冬支度セール 2024年11月4日 (水) ~ 11月12日 (火) 23:59 //

How to Use the pnputil Command for Driver Management | Installing and Removing Drivers in Windows

The pnputil command is a powerful tool in Windows used for managing device drivers. It allows you to install new drivers, remove unused ones, list installed drivers, and export drivers for backup or transfer to other systems. This command-line utility is particularly useful for system administrators who need to automate driver management across multiple devices.

目次

What is the pnputil Command?

The pnputil command is used in Windows for managing drivers installed on the system. It offers functionalities such as installing new drivers, removing old or unused drivers, exporting drivers for backup, and listing all installed drivers. This tool is particularly beneficial for managing drivers in bulk, making it essential for system administrators.

Main Uses

  • Install Drivers: Add new device drivers to the system.
  • Remove Drivers: Free up disk space by removing unused or outdated drivers.
  • List Installed Drivers: Display a list of all drivers installed on the system.
  • Export Drivers: Export drivers for backup or transfer to another system.

How to Use the pnputil Command

pnputil Command Help Image

You must run the pnputil command with administrator privileges. To do so, open Command Prompt as an administrator. This command allows you to handle various driver management tasks, from installing and deleting drivers to managing the driver store.

Basic Syntax

pnputil /add-driver <driver file> [/install]
pnputil /delete-driver <INF file> [/uninstall]
pnputil /enum-drivers
pnputil /export-driver <folder>
OptionDescription
/add-driverAdds the specified driver file to the driver store.
/installInstalls the specified driver file in addition to adding it.
/delete-driverRemoves the specified driver by its INF file.
/uninstallUninstalls the driver and removes related files.
/enum-driversLists all installed drivers on the system.
/export-driverExports drivers to the specified folder.

Example Usages

  1. Installing a Driver
    Use a driver file (INF file) to install a new driver on the system.
   pnputil /add-driver C:\drivers\example.inf /install

Description: Installs the driver located at C:\drivers\example.inf and adds it to the system driver store.

  1. Removing a Driver
    Delete an unused or unwanted driver from the system.
   pnputil /delete-driver oem0.inf /uninstall

Description: Uninstalls and removes the driver identified by oem0.inf.

  1. Listing Installed Drivers
    Display a list of all drivers currently installed on the system.
   pnputil /enum-drivers

Description: Lists all drivers installed on the system, including their names, versions, and installation locations.

  1. Exporting Drivers
    Export all installed drivers to a specified folder for backup or transfer.
   pnputil /export-driver * C:\exported-drivers

Description: Exports all installed drivers to C:\exported-drivers, making them ready for backup or deployment on other systems.

Practical Applications of pnputil

Managing Multiple Drivers

If you need to install or remove multiple drivers at once, you can incorporate the pnputil command into batch files or scripts for automated driver management. This is particularly useful in enterprise environments where managing drivers on multiple machines is necessary.

pnputil /add-driver C:\drivers\printer.inf /install
pnputil /add-driver C:\drivers\audio.inf /install
pnputil /enum-drivers

Description: Installs both the printer and audio drivers, then lists all installed drivers for verification.

Removing Unnecessary Drivers

By removing outdated or unused drivers, you can free up disk space and improve system performance. This is especially useful if old drivers remain after hardware changes.

pnputil /delete-driver oem1.inf /uninstall
pnputil /delete-driver oem2.inf /uninstall

Description: Removes two outdated drivers, freeing up system resources and ensuring no unnecessary drivers are loaded.

Exporting and Backing Up Drivers

If you’re migrating drivers to a new system or creating a backup, the pnputil export feature can be used to save all currently installed drivers.

pnputil /export-driver * C:\backup-drivers

Description: Exports all installed drivers to C:\backup-drivers, making them available for backup or transfer to another system.

Important Considerations

  • Administrator Privileges: You must run the pnputil command as an administrator to perform driver installations, deletions, or exports.
  • Driver Compatibility: Ensure that the driver you are installing is compatible with your system and hardware to prevent potential issues.
  • Critical Driver Removal: Be cautious when removing drivers, especially those in use, as this can lead to system instability or device malfunction.

When to Use the pnputil Command

The pnputil command is essential for efficiently managing drivers in scenarios such as:

  • Deploying drivers across multiple systems.
  • Backing up and exporting drivers for later use.
  • Cleaning up old or unused drivers to optimize system performance.

Conclusion

The pnputil command is a versatile and powerful tool for managing drivers in Windows. From installing and removing drivers to exporting them for backups, this tool streamlines driver management and enhances system performance. For system administrators and power users, mastering pnputil ensures smooth, efficient driver maintenance.

Tamaglo

Thank you for reading!

Comments

To comment

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here

目次