Jump to content


Photo
- - - - -

Clean out your DriverStore


  • Please log in to reply
5 replies to this topic

#1 GodfreyOuwens

GodfreyOuwens

    Novice

  • Members
  • Pip
  • 29 posts
  • Country:United States

  • Brand:Dell
  • Model:XPS M1730
  • Resolution:1920x1200 (WUXGA)
  • Video Card:(0409) GeForce 8700M GT
  • Operating System:Nothing Selected

Posted 17 September 2010 - 07:01 AM

For those that find themselves installing and testing drivers, you may notice that your Windows Vista/7 installation is growing larger and larger. Thats because Windows is storing previous installs in C:\Windows\System32\DriverStore even when you do a driver uninstall. Many of us now use SSD's, and cleaning out MBs or even GBs of space would greatly help...... I know theres other tools that people use like ccleaner etc, but I thought I would just post a quick reg tweak that allows you to add "Take Ownership" to the context menu. This way while browsing thru DriverStore, you can just right-click a file, take-ownership, and delete the file. ( Note: Deleting the wrong file may cause uninstall and rollback problems, but just make sure you know what it is you are deleting )


To add "Take Ownership" to context menu, copy and paste the following into notepad and save as .reg ( then double click the .reg file )

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"

[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Take Ownership"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"



To Remove "Take Ownership" from context menu, copy and paste the following into notepad and save as .reg ( then double click the .reg file )

Windows Registry Editor Version 5.00


[-HKEY_CLASSES_ROOT\*\shell\runas]

[-HKEY_CLASSES_ROOT\Directory\shell\runas]




This may have been posted before, I am not sure, but I thought I would finally add something that I have learned :) .... considering I have only been a member for 4 1/2 years :) Good luck and Good Computing!!!

Edited by GodfreyOuwens, 17 September 2010 - 07:02 AM.


#2 ricktendo64

ricktendo64

    Expert

  • Super Member
  • PipPipPip
  • 262 posts
  • Country:Honduras

  • Brand:Sony
  • Model:VAIO VGC-LV190Y
  • Resolution:1920x1200 (WUXGA)
  • Video Card:(06E9) GeForce 9300M GS
  • SUBSYS:9043104D
  • Operating System:Win7 Ultimate x64

Posted 17 September 2010 - 09:36 AM

Better to use pnputil (if you truly want the driver uninstalled)

Microsoft PnP Utility
Usage:
------
pnputil.exe [-f | -i] [ -? | -a | -d | -e ] <INF name> 
Examples:
pnputil.exe -a a:\usbcam\USBCAM.INF      -> Add package specified by USBCAM.INF
pnputil.exe -a c:\drivers\*.inf          -> Add all packages in c:\drivers\
pnputil.exe -i -a a:\usbcam\USBCAM.INF   -> Add and install driver package
pnputil.exe -e                           -> Enumerate all 3rd party packages
pnputil.exe -d oem0.inf                  -> Delete package oem0.inf
pnputil.exe -f -d oem0.inf               -> Force delete package oem0.inf
pnputil.exe -?                           -> This usage screen

- First create a list of installed 3rd party drivers with this command (creates a file on the desktop)

pnputil -e >%userprofile%\desktop\pnputil.txt

- Now sort thrue the list and see what drivers you wan to remove and use this command

pnputil -d oem#.inf

Note: most times its necessary to use -f switch to force delete the driver

pnputil -f -d oem#.inf

Edited by ricktendo64, 17 September 2010 - 09:37 AM.


#3 mrx

mrx

    Member

  • Members
  • Pip
  • 69 posts
  • Country:United States

  • Brand:Dell
  • Model:Vostro 1500
  • Resolution:1280x800 (WXGA)
  • Video Card:(0407) GeForce 8600M GT
  • SUBSYS:2281028
  • Operating System:Win7 Ultimate x86

Posted 17 September 2010 - 01:05 PM

thanks to this thread. I have been able to recover about 1.5 gigs of space back.

#4 GodfreyOuwens

GodfreyOuwens

    Novice

  • Members
  • Pip
  • 29 posts
  • Country:United States

  • Brand:Dell
  • Model:XPS M1730
  • Resolution:1920x1200 (WUXGA)
  • Video Card:(0409) GeForce 8700M GT
  • Operating System:Nothing Selected

Posted 17 September 2010 - 01:18 PM

thanks to this thread. I have been able to recover about 1.5 gigs of space back.


Awesome! :) glad it helped, whichever method you used :)

#5 mrx

mrx

    Member

  • Members
  • Pip
  • 69 posts
  • Country:United States

  • Brand:Dell
  • Model:Vostro 1500
  • Resolution:1280x800 (WXGA)
  • Video Card:(0407) GeForce 8600M GT
  • SUBSYS:2281028
  • Operating System:Win7 Ultimate x86

Posted 18 September 2010 - 12:56 AM

I used the pnputil way. It work well.

#6 GodfreyOuwens

GodfreyOuwens

    Novice

  • Members
  • Pip
  • 29 posts
  • Country:United States

  • Brand:Dell
  • Model:XPS M1730
  • Resolution:1920x1200 (WUXGA)
  • Video Card:(0409) GeForce 8700M GT
  • Operating System:Nothing Selected

Posted 18 September 2010 - 09:00 AM

I used the pnputil way. It work well.



cool, I'm gonna have to try that utility one of these days :)