Sign in to follow this  
Followers 0

Clean out your DriverStore

6 posts in this topic

Posted (edited) · Report post

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

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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 :)

Share this post


Link to post
Share on other sites

Posted · Report post

I used the pnputil way. It work well.

Share this post


Link to post
Share on other sites

Posted · Report post

I used the pnputil way. It work well.

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

Share this post


Link to post
Share on other sites
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...
Sign in to follow this  
Followers 0