How to Reduce the Size of Your WinSXS Folder on Windows 7 or 8

Posted by Chris Hoffman on How to geek See other posts from How to geek or by Chris Hoffman
Published on Thu, 31 Oct 2013 10:40:21 GMT Indexed on 2013/10/31 16:01 UTC
Read the original article Hit count: 1033

windows-update-cleanup

The WinSXS folder at C:\Windows\WinSXS is massive and continues to grow the longer you have Windows installed. This folder builds up unnecessary files over time, such as old versions of system components.

This folder also contains files for uninstalled, disabled Windows components. Even if you don’t have a Windows component installed, it will be present in your WinSXS folder, taking up space.

Why the WinSXS Folder Gets to Big

The WinSXS folder contains all Windows system components. In fact, component files elsewhere in Windows are just links to files contained in the WinSXS folder. The WinSXS folder contains every operating system file.

When Windows installs updates, it drops the new Windows component in the WinSXS folder and keeps the old component in the WinSXS folder. This means that every Windows Update you install increases the size of your WinSXS folder. This allows you to uninstall operating system updates from the Control Panel, which can be useful in the case of a buggy update — but it’s a feature that’s rarely used.

Windows 7 dealt with this by including a feature that allows Windows to clean up old Windows update files after you install a new Windows service pack. The idea was that the system could be cleaned up regularly along with service packs.

However, Windows 7 only saw one service pack — Service Pack 1 — released in 2010. Microsoft has no intention of launching another. This means that, for more than three years, Windows update uninstallation files have been building up on Windows 7 systems and couldn’t be easily removed.

Clean Up Update Files

To fix this problem, Microsoft recently backported a feature from Windows 8 to Windows 7. They did this without much fanfare — it was rolled out in a typical minor operating system update, the kind that don’t generally add new features.

To clean up such update files, open the Disk Cleanup wizard (tap the Windows key, type “disk cleanup” into the Start menu, and press Enter). Click the Clean up System Files button, enable the Windows Update Cleanup option and click OK. If you’ve been using your Windows 7 system for a few years, you’ll likely be able to free several gigabytes of space.

The next time you reboot after doing this, Windows will take a few minutes to clean up system files before you can log in and use your desktop.

If you don’t see this feature in the Disk Cleanup window, you’re likely behind on your updates — install the latest updates from Windows Update.

delete-windows-update-uninstall-files

Windows 8 and 8.1 include built-in features that do this automatically. In fact, there’s a StartComponentCleanup scheduled task included with Windows that will automatically run in the background, cleaning up components 30 days after you’ve installed them. This 30-day period gives you time to uninstall an update if it causes problems.

startcomponentcleanup-scheduled-task

If you’d like to manually clean up updates, you can also use the Windows Update Cleanup option in the Disk Usage window, just as you can on Windows 7. (To open it, tap the Windows key, type “disk cleanup” to perform a search, and click the “Free up disk space by removing unnecessary files” shortcut that appears.)

disk-cleanup-on-windows-8.1

Windows 8.1 gives you more options, allowing you to forcibly remove all previous versions of uninstalled components, even ones that haven’t been around for more than 30 days. These commands must be run in an elevated Command Prompt — in other words, start the Command Prompt window as Administrator.

For example, the following command will uninstall all previous versions of components without the scheduled task’s 30-day grace period:

DISM.exe /online /Cleanup-Image /StartComponentCleanup

The following command will remove files needed for uninstallation of service packs. You won’t be able to uninstall any currently installed service packs after running this command:

DISM.exe /online /Cleanup-Image /SPSuperseded

The following command will remove all old versions of every component. You won’t be able to uninstall any currently installed service packs or updates after this completes:

DISM.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase

Remove Features on Demand

Modern versions of Windows allow you to enable or disable Windows features on demand. You’ll find a list of these features in the Windows Features window you can access from the Control Panel.

turn-windows-features-on-or-off

Even features you don’t have installed — that is, the features you see unchecked in this window — are stored on your hard drive in your WinSXS folder. If you choose to install them, they’ll be made available from your WinSXS folder. This means you won’t have to download anything or provide Windows installation media to install these features.

However, these features take up space. While this shouldn’t matter on typical computers, users with extremely low amounts of storage or Windows server administrators who want to slim their Windows installs down to the smallest possible set of system files may want to get these files off their hard drives.

For this reason, Windows 8 added a new option that allows you to remove these uninstalled components from the WinSXS folder entirely, freeing up space. If you choose to install the removed components later, Windows will prompt you to download the component files from Microsoft.

windows-install-removed-feature

To do this, open a Command Prompt window as Administrator. Use the following command to see the features available to you:

DISM.exe /Online /English /Get-Features /Format:Table

You’ll see a table of feature names and their states.

windows-features-name-and-state

To remove a feature from your system, you’d use the following command, replacing NAME with the name of the feature you want to remove. You can get the feature name you need from the table above.

DISM.exe /Online /Disable-Feature /featurename:NAME /Remove

remove-windows-feature-from-disk

If you run the /GetFeatures command again, you’ll now see that the feature has a status of “Disabled with Payload Removed” instead of just “Disabled.” That’s how you know it’s not taking up space on your computer’s hard drive.


If you’re trying to slim down a Windows system as much as possible, be sure to check out our lists of ways to free up disk space on Windows and reduce the space used by system files.


    






© How to geek or respective owner

Related posts about Windows

Related posts about Windows 7