How to shrink the main Windows folder?

I'm using Windows 7 64bit Premium for two years now and in this time my C:\Windows folder has grown to almost 30GB which is, in my opinion, inacceptable.

The biggest subfolders are winsxs (10.5 GB), Installer (5.5 GB), System32 (4GB) and SoftwareDistribution(2.5GB). I googled for the winsxs folder and found that it's important and may not be deleted. I googled for the Installer folder and found that it's mostly Office-related and that it might be reduced a bit by deleting Office updates.

But that's not satisfying. Does it really take 27GB to have a working Windows 7 plus up-to-date Microsoft Office?

Is there any way to safely shrink the Windows folder (without having to reinstall Windows 7)?


Apart from compressing the Backup folder in winsxs (in its properties); you can't make the winsxs much smaller, unless you very carefully inspect all the entries as well as whether these are dependencies for applications on your system. But that's a very tedious thing to do, so the best thing you can do about it is installing as much applications and Windows features in the hope for it to turn smaller. Or well, reinstall your system. Please note that this is normal behavior, also listed in the system specifications.

Likewise, the Installer folder contains all your .msi based installation packages. These are kept such that you can still repair or uninstall applications. You can safely compress this folder to gain some space, but don't remove it unless you are sure you never need to repair or uninstall all installed programs.

Everything in the SoftwareDistribution\Download folder can be deleted, these are just downloaded updates from Windows Update. This however might prevent you from being able to roll them back.

Also, regularly empty the C:\Windows\Temp folder if there's anything in there. You are supposed to use the Disk Cleanup wizard with Administrator privileges to do this, rather than doing it manually...


Try running the following command from an elevated command prompt:

DISM /online /Cleanup-Image /SpSuperseded

Source: http://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install


Installer

Leave it be. These are the installer files that are used if you go to "Add and Remove Software" and "Uninstall" or "Repair" software.

SoftwareDistribution

Run Disk Cleanup. Start Explorer, right-click on the C: drive, select Properties find and then click the Disk Cleanup button in the Properties window. Wait until the Disk Cleanup Window appears. Click "Clean up system files". Confirm and wait until the Disk Cleanup Window appears again. In "files to delete" check all boxes - make sure to scroll all the was through the list, there are ~9 items. Click "OK".

WinSxS

Run dism /online /Cleanup-Image /? from the command line. This will give you a list of commands to automatically clean up WinSxS in a safe way, and the implications of each command are spelled out.

First, you should have been running with this set of updates for at least a couple days, better a few weeks, so you know you do not want to roll back any of the updates.

You can then use

  • dism /online /Cleanup-Image /SpSuperseded
  • dism /online /Cleanup-Image /StartComponentCleanup (available on Windows 8, not on Windows 7)

and/or

  • dism /online /Cleanup-Image /StartComponentCleanup /ResetBase (available on Windows 8, not on Windows 7)

to reduce the size of WinSxS. Be sure to read about the side effects of these commands first by running dism /online /Cleanup-Image /?. You can read more about dism at technet.

DriverStore

I'm adding this one because it might be relevant to some people reading this answer: Look for Driverstoreexplorer (http://driverstoreexplorer.codeplex.com/). It's a tool to remove drivers that you don't need - after a few years there are usually a lot of them. Make sure to read up on what it does before you wrec your system. If you're not sure what it does, don't use it.