How To Clean Up WinSxS Folder on Windows 2008 R2 to Gain More Disk Space

WinSxS, a folder called the Windows Component Store that is used during Windows updates, Service Packs, and hotfix installations. It’s located in c:\windows folder containing all the files required to finish these installations. It does grow over time as more updates, features, or roles are added to the installation. Microsoft recommends not touching this WinSxS folder for the purpose of gaining more disk space. But you can do so if you are running short on space by following the right direction.

We have a post that describes how to clean up WinSxS folder on a Windows 8 computer but unfortunately, the same step doesn’t seem to be working on a Windows Server 2008 R2 system. If you have a 2008 R2 server that runs short on the system drive, this post will definitely help you.

Before I took the same steps on one of my servers, I used a free folder analysis tool called TreeSize Free to check my system drive to see how many spaces are occupied by this WinSxS folder, a total of 14GB.

WinSxS size on Windows 2008 R2

The proper way of doing things like this is to use a built-in tool called Disk Cleanup. Unfortunately, it’s not installed by default when you first installed Windows Server 2008 R2. So, the first step we need to do is to install Disk Cleanup utility which is part of a system feature called Desktop Experience.

Go to Control Panel → Turn Windows features on or off, and click Add Features in Feature Summary section. A wizard pops up.

Add Features Wizard

Check Desktop Experience from the list, click Add Required Features if another window pops up, go to Next, and Install. It takes a few moments to finish. Once it’s done, restart your server to finish the installation process.

Next step, you will need to install a separate Windows Update that adds an additional option to delete outdated Windows updates. Go to this download page and download the update specifically for Windows Server 2008 R2. Then install it. It doesn’t require a reboot once it’s installed.

Installing windows update KB2852386

Now let’s get to the real cleaning process. Go to Start → All Programs → Accessories → System Tools, and launch Disk Cleanup.

Disk Cleanup - Scanning

Disk Cleanup - files to delete

Check both Service Pack and Windows Update Cleanup, as well as any other related to the upgrade. In my case, that’s going to free up almost 6GB of space from my system drive. Click OK to delete these selected files.

Disk Cleanup - Cleaning

Now let’s run TreeSize free tool again and see how much space I gained from this process. Note that you may need to restart the server to see the difference.

WinSxS Size after cleanup

That’s it. If you have quite a few Windows 2008 R2 servers, you can automate this process by using this PowerShell script.

Kent Chen

Microsoft MVP, IT Professional, Developer, Geek, and the co-founder of Next of Windows.

Last updated: 01/14/2016

Posted in: Tips & Tricks
Discover more: , , ,

Leave a Reply

Notify of
avatar
wpDiscuz
Today's Top Picks for Our Readers:
Recommended by Recommended by NetLine