Remove all drivers from windows

How to Remove Unused Drivers from Driver Store

When you install or update device drivers in Windows, older driver versions are still stored in the system. Thus, a user can roll back to the previous driver version if the new driver is unstable (a useful opportunity, as in the case of rolling back a Wi-Fi driver). However, Windows does not automatically clean and delete old driver versions, so as the time goes the size of disk space occupied by drivers becomes quite large. In this article, we’ll discuss how to remove old driver versions (duplicates) using the integrated system tools (without any third-part software).

Windows stores all driver files in its driver repository (Driver Store) located in %WINDIR%\System32\DriverStore\FileRepository. In my case on my home laptop running Windows 7 (installed almost 8 years ago), FileRepository folder occupies about 11 GB and contains over 5,000 files. It’s a good many! In particular, over 20 Nvidia driver versions are stored here.

  • Never delete any files from DriverStore manually.
  • Prior to clearing up the Driver Store, it is strongly recommended that you create a system restore point ( Checkpoint-Computer -Description «BeforeDriversDelete» ) or back up your system image.
  • After cleaning the storage, you may have to download and install drivers manually if a new device is connected.

How to Find and Delete Old Driver Versions in Windows 7

Let’s see how to find and delete obsolete drivers in Windows 7. (In Windows 8 and Windows 10, easier ways to delete old drivers are used, these are described below).

Get the list of all third-party drivers available in the system and export them to a text file. To do it, run the following command in the command prompt with the administrator privileges:

dism /online /get-drivers /format:table > c:\tmp\drivers.txt

Import this text file into Excel, and delete all odd data in a way that only the table containing the list of drivers in the repository is left. The table should contain the number of the driver in the system (oemXXX.inf), the name of the original INF file, device class, manufacturer, installation date and driver version.

Sort this table by column B (containing the name of the original INF file) and column F (driver installation date). Among the drivers with the same name mark for removal all driver versions except the last one. In my case, you can see that the most part of old drivers are refer to the NVIDIA video adapter.

To delete a driver, you can use pnputil command:

pnputil.exe -d oemxxx.inf

To make it more convenient, we will create in the empty column the commands to remove each driver using the formula: =CONCATENATE(«pnputil.exe -d «;A21)

Copy and run these commands in the command prompt or a BAT file.

pnputil.exe –d oem9.inf
Microsoft PnP Utility
Driver package deleted successfully

Thus, I have deleted about 40 old driver versions and freed about 8 GB of space (mostly due to removing of NVIDIA drivers).

How to Delete Old Drivers in Windows 10/8 Using Disk Cleanup

In Windows 10 / 8.1, there is a more convenient tool to delete earlier driver versions — familiar Disk Cleanup tool (cleanmgr.exe) that also allows to delete deprecated updates.

  • Run Disk Cleanup: Win+R ->cleanmgr
  • Select the system disk
  • Click Clean up system files
  • Check Device driver packages in the list
Читайте также:  Как откатить обновление для windows 10

Cleanmgr will delete all old unused driver versions. However, you should understand that the Roll back driver button in Driver Properties tab of Device Manage will become inactive.

Add and Remove Drivers to an offline Windows Image

You can use DISM to install or remove driver (.inf) files in an offline Windows or WinPE image. You can either add or remove the drivers directly by using the command prompt, or apply an unattended answer file to a mounted .wim, .ffu, .vhd, or .vhdx file.

When you use DISM to install a device driver to an offline image, the device driver is added to the driver store in the offline image. When the image is booted, Plug and Play (PnP) runs and associates the drivers in the store to the corresponding devices on the computer.

To add drivers to a WindowsВ 10 image offline, you must use a technician computer running WindowsВ 10, Windows ServerВ 2016, or Windows Preinstallation Environment (WinPE) for WindowsВ 10. Driver signature verification may fail when you add a driver to a WindowsВ 10 image offline from a technician computer running any other operating system.

To learn how to add a driver on a running Windows PC, see Add a driver online in audit mode or Install a plug and play device. To learn how to add a driver to a PC running WinPE, see Drvload command line options.

Driver types

  • .inf-style drivers: Many drivers include an information file (with an .inf extension) to help install the driver. These can be installed using tools described in this topic.
  • .exe-style drivers: Drivers without an .inf file often must be installed like typical Windows desktop applications. To learn how to add these, see Add a driver online in Audit Mode
  • Boot-critical drivers: Graphics and storage drivers may sometimes need to be added to the Windows image (as shown in this topic), as well as the Windows PE image, and in the Windows recovery (WinRE) image.

Add drivers to an offline Windows image

To add drivers to an offline image, you have to mount an image prior to adding drivers.

If you’re adding drivers to a WinPE image, you can add them to the WinPE image in the output folder you specified when you ran copype, for example: C:\WinPE_amd64\media\sources\boot.wim . This ensures that drivers will be included in WinPE each time you build WinPE media from that folder.

  1. Mount a Windows image. For example:
  1. Add a driver to the image.

To install all of the drivers from a folder and all its subfolders, point to the folder and use the /Recurse option.

To see all DISM driver servicing command line options, see DISM driver servicing command-line options.

Using /Recurse can be handy, but it’s easy to bloat your image with it. Some driver packages include multiple .inf driver packages, which often share payload files from the same folder. During installation, each .inf driver package is expanded into a separate folder. Each individual folder has a copy of the payload files. We’ve seen cases where a popular driver in a 900MB folder added 10GB to images when added with the /Recurse option.

To install an unsigned driver, use /ForceUnsigned to override the requirement that drivers installed on X64-based computers must have a digital signature.

  1. Check to see if the driver was added. Drivers added to the Windows image are named Oem*.inf. This guarantees unique naming for newly added drivers. For example, the files MyDriver1.inf and MyDriver2.inf are renamed Oem0.inf and Oem1.inf.
  1. Commit the changes and unmount the image.
Читайте также:  How to get any windows password

Remove drivers from an offline Windows image

  1. At an elevated command prompt, mount the offline Windows image:
  1. Remove a specific driver from the image. Multiple drivers can also be removed on one command line.

Removing a boot-critical driver package can make the offline Windows image unbootable. For more information, see DISM Driver Servicing Command-Line Options. пїЅ

  1. Commit the changes and unmount the image.

Add drivers to an offline Windows image by using an unattended answer file

  1. Gather the device driver .inf files that you intend to install on the Windows image.

All drivers in the directory and subdirectories that are referenced in the answer file are added to the image. You should manage the answer file and these directories carefully to address concerns about increasing the size of the image with unnecessary driver packages.

  1. Use WindowsВ System Image Manager (WindowsВ SIM) to create an answer file that contains the paths to the device drivers that you want to install.
  • Add the Microsoft-Windows-PnpCustomizationsNonWinPE\DriverPaths\PathAndCredentials\Credentials component to your answer file in the offlineServicing configuration pass.

For each location that you intend to access, add a separate PathAndCredentials list item by right-clicking on DriverPaths in the Answer File pane and clicking Insert New PathAndCredentials.

See Configure components and settings in an answer file for information on how to modify an answer file.

  1. For each path in Microsoft-Windows-PnpCustomizationsNonWinPE , specify the path to the device driver and the credentials that are used to access the file, if the file is on a network share.

When you include multiple device driver paths by adding multiple PathAndCredentials list items, you must increment the value of Key for each path. For example, you can add two separate driver paths where the value of Key for the first path is equal to 1 and the value of Key for the second path is equal to 2.

  1. Save the answer file and exit WindowsВ SIM. The answer file must resemble the following sample.
  1. Mount the Windows image that you intend to install the drivers to by using DISM:

If you’re working with a VHD or FFU, specify /Index:1 .

  1. Apply the answer file to the mounted Windows image:

For more information about how to apply an answer file, see DISM Unattended Servicing Command-Line Options.

The .inf files referenced in the path in the answer file are added to the Windows image.

  1. Check to see if the driver was added. Drivers added to the Windows image are named Oem*.inf. This guarantees unique naming for newly added drivers. For example, the files MyDriver1.inf and MyDriver2.inf are renamed Oem0.inf and Oem1.inf.

For example, type:

  1. Unmount the .wim file and commit the changes. For example, type:

If you need drivers for WinPE to see the local hard disk drive or a network, you must use the windowsPE configuration pass of an answer file to add drivers to the WinPE driver store and to reflect boot-critical drivers required by WinPE. For more information, see Add Device Drivers to Windows During Windows Setup.

How to Uninstall Drivers in Windows

By Michael King

Today’s Best Tech Deals

Picked by PCWorld’s Editors

Top Deals On Great Products

Picked by Techconnect’s Editors

Читайте также:  Special files in windows

Installing drivers can be a hair-raising adventure, even on today’s modern operating systems. These finicky pieces of code act as the middleman between your PC’s hardware and its operating system. Although they install with ease just like any other software, they integrate deeply into the OS, sinking their teeth into areas most other software doesn’t go near. Most of the time the driver installation process is simple, seamless, and transparent to you, as it should be.

On those occasions when things go wrong, however, they can go really wrong, and even crash your entire computer. For example, when Microsoft’s Windows Vista came out in 2007, critics lambasted it for being slow and prone to crashing; Microsoft investigated the causes and found that a majority of crashes were due to driver issues.

Thankfully, when you prepare yourself for battle with a problematic driver, you have a couple of tricks that can help. Microsoft has introduced an easy way to roll back to a previous (and, you hope, more stable) version of the driver, or remove it from the system altogether, giving you a clean slate to try again or install a different version.

Roll Back to a Previous Driver

  1. Click Start, type Device Manager, and press Enter.
  2. Find and double-click the category of device causing the issue (for instance, the graphics card would be listed under Display Adapters).
  3. Double-click the problematic device to bring up the Properties window.
  4. Click the Driver tab.
  5. Click the Roll Back Driver button.
  6. A dialog box will ask you to confirm your decision to roll back to a previous driver. Click Yes to begin the roll-back process. Use the Properties menu to uninstall your driver software or roll back to a previous version.

At this point Windows will automatically remove the current driver for the device and reinstall the previous driver. You may then receive a notification that the system settings have changed, and Windows will ask you to reboot. If you see that message, you should reboot your computer as soon as possible.

Uninstall a Driver

When you need to uninstall a driver completely, the best and safest method is to use the device’s uninstaller program (if it has one). If you added the device to your system through an installer (as is the case with most graphics card and sound card drivers, for instance), you can uninstall it just as you would any other program.

  1. Click Start, type Uninstall Program, and press Enter.
  2. In the Uninstall window that appears, go through the list and find your device or drivers. Double-click the entry to begin the uninstallation process.

Sometimes devices won’t have an uninstaller, or the uninstaller will not appear in the list. In those instances, you can use the Device Manager to remove the driver completely.

  1. Click Start, type Device Manager, and press Enter.
  2. Find and double-click the category of device whose driver you wish to uninstall (for example, the graphics card would be listed under Display Adapters).
  3. Right-click the device, and click Uninstall.
  4. Windows will prompt you to confirm the device’s removal. Click OK to remove the driver.
  5. After the uninstallation is complete, reboot your computer as soon as possible. In a pinch you can use the Windows Device Manager to uninstall troublesome driver software.

After you roll back or uninstall a problematic driver, you can try downloading and installing the latest version from the manufacturer’s website, or try a specific version that previously worked to get your computer back on its feet.

Оцените статью