[Tool] Free a lot of space by cleaning up drivers on Vista/Win7/8

Discussion in 'Windows 7' started by Berny, Mar 27, 2013.

  1. Berny

    Berny MDL Member

    Jul 29, 2009
    #1 Berny, Mar 27, 2013
    Last edited by a moderator: Apr 20, 2017
    [Tool] Free a lot of space by cleaning up the drivers cache on Vista/Win7/8

    Every Windows version since Vista, including Windows 7 and Windows 8, removed the uninstall routine often used by drivers to clean up the previous cached versions. Every time you install a new driver the previous version remains installed and some drivers, especially the graphic drivers, can waste a lot of space on the hard drive, with hundreds of megabytes left for every new version you install. With this simple batch file you can clean any third party driver that is no longer associated to a device (outdated or never used).

    NOTE: all the Windows default drivers, are left untouched, this only affects third party drivers that were installed by the user or by the computer manufacturer.

    Save this in a .BAT file and run as administrator (if you simply want to run the two commands in a prompt change %%F with %F)
    cd %WINDIR%\INF
    for %%F in (oem*.inf) do pnputil -d %%F
    This software is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the regents or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption)
    however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

    Attached Files:

  2. Sunesu

    Sunesu MDL Novice

    Mar 30, 2013
    Thanks! I signed up here just to say that, you helped me save a lot of space with this little tweak.
  3. PhaseDoubt

    PhaseDoubt MDL Expert

    Dec 24, 2011
    I'm a bit curious. How much space is "a lot"?
  4. fkar

    fkar MDL Recognized Advisor

    Nov 3, 2012
    Saved tiny space.

    BTW, thanks for your contribution.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...