Shrink the Size of Winsxs in Windows 7

Microsoft has never met a gigabyte of storage space it didn’t like for underlying operating system needs. As hard drive capacities have increased, this has gotten worse. While I normally wouldn’t care, the introduction of solid state drives have changed the game. Now costs for storage space have gone back up and limits have contracted.

Once you move to an SSD, you won’t go back. I have the luxury of having a 256 GB SSD in both my home and work laptops. If you threatened to take either from me, I may shoot you.

This evening I was doing some drive clean up using my favorite disk space analyzer WinDirStat. It showed that besides my ridiculously huge Users directory (I have a couple of virtual machines in there), the Windows directory itself was consuming 31.9 GB of space. Good gravy that’s crazy!

The worst offender was the Winsxs directory. To read more about what Winsxs actually does, go here.

I did a bit of googling to try to figure out if and how that folder could be pared down. Most posts mentioned that it is critical to the OS, don’t try to delete it or your sky will fall and your Windows will crash with it. Other sites mentioned a tool that came out with Vista, that Microsoft neglected to include with Windows 7 SP1.

Then I came across this forum.

Which pointed me to this post.

Which gave me this command:

dism /online /cleanup-image /spsuperseded

What this command does is remove superseded updates that are no longer needed after the installation of Service Pack 1. These updates are still kept around in case you want to uninstall SP1. As I have no plans on doing so, these files serve no purpose other than aggravating my quest to have more free hard drive space.

And that command gave me back 5 GB of space. A 6.5 GB winsxs is still crazy, but just not as stupid crazy as 11.5 GB. I’ll take a 43% reduction whenever I can get it.

Now to shrink the size of the rest of the Windows directory!



Was this post helpful?

If you enjoyed or benefited from this post, please consider any of the following:
  • post with your friends
  • Leave a comment below
  • Donate cash to support this site.
  • Pingback: Quick useful command lines | David Latapie()

  • someone

    I’ve read that this keeps copies of every type of component install for every system type, even if you don’t have that type of system… ex. AMD vs. Intel and x86 vs. x64 files.  There must be a way for Win7 to only keep what you use, and trash the rest… or better yet, profile the system and only grab the things you need.

  • Funk Thompson

    So… any way to shrink it beyond the DISM command? We are doing a VDI project and many users on VDI are running out of disk space, with WinSxS folder taking up about 5 to 7 GB on average. These are VDI’s allocated to 33GB, and Windows is taking up 15GB of that on its own… another 7 or 8 in Program Files on average, etc. and we have a bunch of users with only 1 to 2 GB free at most.

    And, because these are Windows SP-1 Builds – they were installed using Win7 SP1 and never had the service pack actually applied – the DISM command does nothing.

  • I can’t really speak to that as:
    1 – I have no VDI experience, yet. Not that it isn’t on my plate. It’s more like it could be the dessert course of my project buffet. Just haven’t gotten around to tackling any VDI projects yet.

    2 – And there may be another command, but the only one I could find for Win7 at all was the dism command. There were some tools in Vista that addressed this issue, but those were left out of Win7.

    Some questions (none of which necessarily solve your issue):
    – Could you map the user’s file storage to a network share somewhere?
    – Could the image you are publishing to your VDI clients be rebuilt? That’s probably a nuclear solution, and may end in the same result knowing how MS abuses HD space.

  • Triple-X Beatz

    Man THANK YOU so much. My winsxs folder was almost 13GB, and I got it down to 6.6GB after this command.

    I have a Vertex2 60GB that iREALLY like to keep as close to 50% free as possible, and I was down to 16GB free or so. This is a Audio Workstation for recording and editing music, so the majority of what is installed is NOT stuff I can simply just remove to save space. Especially when its useless windows files like I just removed that are hogging that space and SHOULD go FIRST!

    SO again, THANK YOU VERY MUCH!!!

    ppl just dont take the time to say thank you anymore.
    I appreciate this!

  • n0manarmy

    Just an FYI, I followed your directions for this and I ran in to a problem doing this in audit mode. This is MS’s article on how to get past the issue I had. Your post was a huge help though!

  • Wow this was fantastic. I had previously read about the winsxs folder and saw the DISM tool somewhere else but this succinct post convinced me to try it and it worked great. My winsxs folder was taking up 12.2GB on my lowly 64GB Win7 SSD (over 20%!!!) and now it’s down to 8.1GB. It saved 7% of my SSD space.

    I used WinDirStat too by the way.

  • Pingback:

Post Navigation