Windows OS Hub
  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Group Policies
  • Windows Clients
    • Windows 10
    • Windows 8
    • Windows 7
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
  • PowerShell
  • Exchange

 Windows OS Hub / Windows 10 / How to Remove Unused Drivers from Driver Store

July 29, 2017 Windows 10Windows 7

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.

large size of folder DriverStore

Contents:
  • How to Find and Delete Old Driver Versions in Windows 7
  • How to Delete Old Drivers in Windows 10/8 Using Disk Cleanup

Important!

  • 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

dism /online /get-drivers /format:table - export driver list to a txt file

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

Note. In some cases, you must delete a driver only using only force  –f: pnputil -f -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)

analyze old drivers list in excel

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

pnputil Driver package deleted successfully

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.

Note. In Windows 10 and Windows 8 Upd 1, there is an opportunity to export all third party drivers from the system to a separate directory using PowerShell.
  • Run Disk Cleanup: Win+R -> cleanmgr
  • Select the system diskdisk cleanup drive c
  • Click Clean up system files Clean up system files
  • Check Device driver packages in the listCleanup Device driver packages - Windows 10
    Note. In my system the size of stored driver copies is 0. In real systems it is likely to be different
  • Click OK

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.

6 comments
2
Facebook Twitter Google + Pinterest
previous post
Prevent Changing IE Proxy Settings Using GPO
next post
Automatic Virtual Machine Activation (AVMA) in Windows Server 2016

Related Reading

How to Sign a PowerShell Script (PS1) with...

February 25, 2021

How to Shadow (Remote Control) a User’s RDP...

February 22, 2021

Configuring PowerShell Script Execution Policy

February 18, 2021

Configuring Proxy Settings on Windows Using Group Policy...

February 17, 2021

Updating Group Policy Settings on Windows Domain Computers

February 16, 2021

6 comments

Marko June 13, 2018 - 8:16 pm

great article!!! thanks a million!

Reply
KV January 31, 2019 - 4:30 pm

How did you import from the txt file to excel? Copy and paste just leaves all the info in the first column of cells

Reply
admin February 8, 2019 - 5:19 pm

You shold use “Tab” as a delimeter when importing a txt file to Excel

Reply
Emily Bowman January 26, 2020 - 7:06 am

Note that you cannot copy-paste between regular and administrator windows if UAC is active. You have to retype anyway or use the filesystem to transfer commands (like make a batch file and then run it from admin).

Nvidia and Intel are so aggravating with their massive drivers that never clean up after themselves. Lots of other places they suck up space around the system, too, like the shader cache.

Reply
John Schindler May 1, 2020 - 5:10 pm

Nice, but the file I want to remove “is not an installed OEM inf”.

Reply
Emily Bowman May 1, 2020 - 7:38 pm

The best way to remove a built-in windows component is with NTLite and reinstall. Once installed, there’s not much you can do.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange
  • Windows 10
  • Windows 8
  • Windows 7
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2008 R2
  • PowerShell
  • VMWare
  • MS Office

Recent Posts

  • How to Sign a PowerShell Script (PS1) with a Code Signing Certificate?

    February 25, 2021
  • Change the Default Port Number (TCP/1433) for a MS SQL Server Instance

    February 24, 2021
  • How to Shadow (Remote Control) a User’s RDP session on RDS Windows Server 2016/2019?

    February 22, 2021
  • Configuring PowerShell Script Execution Policy

    February 18, 2021
  • Configuring Proxy Settings on Windows Using Group Policy Preferences

    February 17, 2021
  • Updating Group Policy Settings on Windows Domain Computers

    February 16, 2021
  • Managing Administrative Shares (Admin$, IPC$, C$, D$) in Windows 10

    February 11, 2021
  • Packet Monitor (PktMon) – Built-in Packet Sniffer in Windows 10

    February 10, 2021
  • Fixing “Winload.efi is Missing or Contains Errors” in Windows 10

    February 5, 2021
  • How to Move (Clone) Windows to a New Hard Drive (HDD/SSD)?

    February 4, 2021

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Booting Windows 7 / 10 from GPT Disk on BIOS (non-UEFI) systems
  • Removable USB Flash Drive as Local HDD in Windows 10 / 7
  • How to Create a Wi-Fi Hotspot on your Windows 10 PC
  • How to increase KMS current count (count is insufficient)
  • How to Download APPX Installation File from Microsoft Store in Windows 10 / 8.1
  • How to Sign an Unsigned Driver for x64 Windows 10, 8.1 or 7 with a Self-signed Certificate
  • How to Hide Installed Programs from Programs and Features in Windows?
Footer Logo

@2014 - 2018 - Windows OS Hub. All about operating systems for sysadmins


Back To Top