How to Clean Up the WinSxS Folder (Component Store) in Windows 8.1

The WinSxS folder is located in the Windows folder, for example C:\Windows\WinSxS. It’s the location for Windows Component Store files. The Windows Component Store is used to support the functions needed for the customization and updating of Windows. Here are some examples of how the Windows Component Store files are used:
One commonly asked question is can I delete the WinSxS folder to regain some disk space? The short answer is no. (see warning box below) However, there are ways to reduce the size of the WinSxS folder.
Windows 8.1 and Windows Server 2012 R2 automatically reduces the size of the WinSxS by using methods similar to the ones described in this tutorial, however these methods also include internal processes, such as uninstalling and deleting packages with components that have been replaced by other components with newer versions. Previous versions of some components are kept on the system for a period of time, allowing you to rollback if necessary. After a period of time, these components are removed from the installation.
For more information about the component store, see:
This tutorial will show you a number of ways to start the cleanup of the component store (WinSxS folder) to free up a large amount of disk space in Windows 8.1 and Windows Server 2012 R2.
- Using Windows Update to install new component versions. This keeps systems secure and up-to-date.
- Enabling or disabling Windows features.
- Adding roles or features using Server Manager.
- Moving systems between different Windows Editions.
- System recovery from corruption or boot failures.
- Uninstalling problematic updates.
- Running programs using side-by-side assemblies.
One commonly asked question is can I delete the WinSxS folder to regain some disk space? The short answer is no. (see warning box below) However, there are ways to reduce the size of the WinSxS folder.
Windows 8.1 and Windows Server 2012 R2 automatically reduces the size of the WinSxS by using methods similar to the ones described in this tutorial, however these methods also include internal processes, such as uninstalling and deleting packages with components that have been replaced by other components with newer versions. Previous versions of some components are kept on the system for a period of time, allowing you to rollback if necessary. After a period of time, these components are removed from the installation.
For more information about the component store, see:
This tutorial will show you a number of ways to start the cleanup of the component store (WinSxS folder) to free up a large amount of disk space in Windows 8.1 and Windows Server 2012 R2.

Manually deleting files from the WinSxS folder or deleting the entire WinSxS folder may severely damage your system so that your PC might not boot and make it impossible to update.
Use one of the recommended options you would like to do in this tutorial below instead.
Use one of the recommended options you would like to do in this tutorial below instead.
In Preparation
Do this Tip First before doing an Option below

If you have not already, use the tutorial at the link below to determine if component store cleanup is recommended or not first. This way you can also see how much space will be recovered.
How to Determine Size and if you should Clean Up Component Store (WinSxS folder) in Windows 8.1
There's no need to do any of the options below if component store cleanup is not recommended at the link above.
How to Determine Size and if you should Clean Up Component Store (WinSxS folder) in Windows 8.1
There's no need to do any of the options below if component store cleanup is not recommended at the link above.
CONTENTS:
- Option One: To Clean Up WinSxS Folder using StartComponentCleanup Task
- Option Two: To Clean Up WinSxS Folder using /StartComponentCleanup with Dism
- Option Three: Clean Up WinSxS Folder using /StartComponentCleanup and /ResetBase with Dism
- Option Four: To Clean Up WinSxS Folder using /SPSuperseded with Dism
- Option Five:To Clean Up WinSxS Folder using Windows Update Cleanup in Disk Cleanup
OPTION ONE
To Clean Up WinSxS Folder using StartComponentCleanup Task

The StartComponentCleanup task was created in Windows 8 to regularly clean up components automatically when the system is not in use. This task is set to run automatically when triggered by the operating system. When run automatically, the task will wait at least 30 days after an updated component has been installed before uninstalling the previous versions of the component.
If you choose to run this task, the task will have a 1 hour timeout and may not completely clean up all files.
If you choose to run this task, the task will have a 1 hour timeout and may not completely clean up all files.
1. Press the :winkey: + R keys to open the Run Dialog, type Taskschd.msc, and press Enter.
2. If prompted by UAC, then click/tap on Yes.
3. In the left pane of Task Scheduler, expand the console tree, and navigate to and open Servicing at location below. (see screenshot below)
Task Scheduler Library\Microsoft\Windows\Servicing
4. In the middle pane of Servicing, select the StartComponentCleanup task, and click/tap on Run under Selected Item in the right pane. (see screenshot above)
5. You'll now notice that the StartComponentCleanup task is now running. This will take a while to finish running. (see screenshot below).
6. If you like, you can close Task Scheduler since it's not required to remain open. It's recommended to let the computer stay running or sit idle until the task has finished running.
OPTION TWO
To Clean Up WinSxS Folder using /StartComponentCleanup with Dism

Using the /StartComponentCleanup parameter of Dism.exe on a running version of Windows 8.1 gives you similar results to running the StartComponentCleanup task in OPTION ONE above, except previous versions of updated components will be immediately deleted (without a 30 day grace period) and you will not have a 1-hour timeout limitation.
1. Open an elevated command prompt.
2. In the elevated command prompt, copy and paste the command below, and press Enter. (see screenshot below)
Dism.exe /online /Cleanup-Image /StartComponentCleanup
3. When successfully finished, you can close the elevated command prompt if you like. This could take a while to finish depending on how much there was to clean up.
OPTION THREE
To Clean Up WinSxS Folder using /StartComponentCleanup and /ResetBase with Dism

Using the /ResetBase switch with the /StartComponentCleanup parameter of DISM.exe on a running version of Windows 8.1 removes all superseded (outdated) versions of every component in the component store.
All existing service packs and updates cannot be uninstalled after this command is completed. This option will not block the uninstallation of future service packs or updates installed.

1. Open an elevated command prompt.
2. In the elevated command prompt, copy and paste the command below, and press Enter. (see screenshot below)
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
3. When successfully finished, you can close the elevated command prompt if you like. This could take a while to finish depending on how much there was to clean up.
OPTION FOUR
To Clean Up WinSxS Folder using /SPSuperseded with Dism

To reduce the amount of space used by a Service Pack, use the /SPSuperseded parameter of Dism.exe on a running version of Windows 8.1 to remove any backup components needed for uninstallation of the service pack. A service pack is a collection of cumulative updates for a particular release of Windows.
The service pack cannot be uninstalled after this command is completed.

1. Open an elevated command prompt.
2. In the elevated command prompt, copy and paste the command below, and press Enter. (see screenshot below)
Dism.exe /online /Cleanup-Image /SPSuperseded
(If no service pack backup files found)
3. When successfully finished, you can close the elevated command prompt if you like. This could take a while to finish depending on how much there was to clean up.
OPTION FIVE
To Clean Up WinSxS Folder using Windows Update Cleanup in Disk Cleanup

This option is to use the Windows Update Cleanup option in Disk Cleanup to delete outdated Windows updates from the WinSxS folder (component store) to free up hard drive space.
1. For how, see: How to Use Windows Update Cleanup in Windows 8 and 8.1
That's it,
Shawn
Attachments
Last edited by a moderator: