В этой статье мы поговорим о каталоге WinSxS в Windows, причинах его постоянного роста и способах очистки. Каталог C:\windows\WinSxS является хранилищем компонентов Windows. В этом каталоге хранятся dll библиотеки, бинарные и xml файлы, необходимые для установки и работы различных ролей и компонентов Windows. Каждый раз когда вы устанавливаете обновления Windows (это происходит ежемесячно), новая версия обновляемого компонента устанавливается в систему, а старая сохраняется в хранилище компонентов WinSxS (это необходимо для обеспечения совместимости и возможности “отката“ к старым версиям компонентов при удалении проблемного обновления).
Со временем размер каталога WinSxS постоянно увеличивается. Причем его размер ничем не ограничен (хотя на практике размер папки WinSxS в Windows 10 редко превышает 15-20 Гб.)
В этой статье мы рассмотрим наиболее безвредные способы очистки папки WinSxS в Windows 10 и Windows Server.
- Оптимизация хранилища компонентов и удаление старых версий компонентов, оставшихся после установки обновлений Windows;
- Технология Features on Demand (функции по требованию), позволяющая удалить неиспользуемые компоненты Windows с диска;
- Сжатие файлов в папке WinSxS – способ уменьшить размер каталога WinSxS за счет включения NTFS компрессии.
У многих пользователей возникает естественный вопрос можно ли вручную удалить файлы из папки WinSxS. Ответ на этот вопрос – категоричное НЕТ! Такими действиями с большой долей вероятности вы сломаете свою Windows. И хотя отдельные попытки удаления конкретных файлов из папки WinSxS могут быть удачными, рекомендовать этот способ нельзя.
Содержание:
- Как узнать реальный размер папки WinSxS в Windows 10?
- Очистка хранилища компонентов WinSxS в Windows
- Удаление неиспользуемых компонентов Windows (Windows Server)
- Включаем NTFS сжатие на папке WinSxS в Windows
Как узнать реальный размер папки WinSxS в Windows 10?
Самый простой способ получить текущий размер каталога WinSxS в Windows, запустить проводник File Explorer и открыть свойства папки %windir%\WinSxS (или воспользоваться скриптом PowerShell). Но имейте в виду, что большинство файловых менеджеров (в том числе File Explorer) показывают несколько больший размер каталога WinSxS, чем он занимает на диске.
Дело в том, что в каталоге WinSxS есть большое количество hard links (жестких символических ссылок) на файлы в других системных каталогах. Файловые менеджеры при подсчете размера папки WinSxS учитывают объем файлов, на которые ссылаются жесткие ссылки, а это не корректно.
Чтобы реальный (без учета жестких ссылок) размер папки WinSxS, воспользуйтесь утилитой SysInternal du:
du -v c:\windows\winSXS
Но проще всего проанализировать размер хранилища компонентов в папке WinSxS с помощью команды DISM:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
Разберемся, что возвращает данная команда:
Размер хранилища компонентов по данным проводника : 5.70 GB (это размер хранилища с учета жестких ссылок, который отображается в проводнике)
Фактический размер хранилища компонентов : 5.49 GB (реальный размер хранилища компонентов за исключением жестких ссылок)
Совместно с Windows : 3.12 GB (обязательные файлы системы, не могут быть удалены)
Резервные копии и отключенные компоненты : 2.12 GB (устаревшие файлы компонентов, которые нужны на случай проблем с установленными обновлениями)
Кэш и временные данные : 245.87 MB (файлы используются для ускорения работы системы обслуживания)
Дата последней очистки : 2018-07-31 12:45:23
Число освобождаемых пакетов : 10 (файлы, которые обновились после установки обновлений Windows, они будут удалены при очистке хранилища)
Рекомендуется очистка хранилища компонентов : Да
Как вы видите, в данном случае можно уменьшить размер каталога WinSxS на 2.1 Гб + 250 Мб.
Очистка хранилища компонентов WinSxS в Windows
Самый быстрый и простой способ освободить место в хранилище компонентов Windows (т.е. очистить папку WinSxS) – оптимизация хранилища командой:
Dism.exe /Online /Cleanup-Image /StartComponentCleanup
Опция Dism /StartComponentCleanup поддерживается во всех версиях Windows, начиная с Windows 8/Windows Server.
После окончания очистки проверьте текущий размер хранилища компонентов:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
В моем примере это помогло уменьшить размер папки WinSxS на 2,5 Гб.
С помощью еще одного параметра /ResetBase вы можете удалить все предыдущие версии компонентов, оставшиеся после установки обновлений Windows. После этого вы не сможете удалить установленные обновления или Service Pack, а в панели обновлений
appwiz.cpl
у обновлений пропадет кнопка «Удалить»).
Чтобы очистить старые версии компонентов, выполните:
Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase
В Windows 7 и Windows Server 2008 R2 для очистки старых версий компонентов, оставшихся после установки сервис пака, использовался еще один параметр DISM:
dism /online /Cleanup-Image /spsuperseded
Также вы можете удалить устаревшие обновления с помощью мастера очистки диска. Выполните команду cleanmgr c правами администратора.
В окне утилиты выберите диск и в следующем окне нажмите кнопку «Очистить системны файлы».
Далее выберите опцию “Файлы журнала обновления Windows» и нажмите ОK. Утилита очистки диска покажет сколько места вы можете освободить, удалив файлы журнала старых обновлений Windows. В моем примере это 427 Мб.
После окончания очистки хранилища с помощью DISM проверьте сколько освободилось места на диске.
В планировщике задания Windows 10 и Windows Server 2016 есть специальное задание автоматического обслуживания, которое регулярно выполняет оптимизацию и очистку каталога WinSxS (выполняется действия, аналогичные команде dism с ключом StartComponentCleanup). Это задание StartComponentCleanup находится в разделе \Microsoft\Windows\Servicing. Данное задание запускается в фоновом режиме и автоматически удаляет версии компонентов старше 30 дней, которое были заменены более новыми версиями.
Можно запустить это задание вручную так:
schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"
Удаление неиспользуемых компонентов Windows (Windows Server)
В статье Безопасная очистка папки WinSxS в Windows Server 2016/2012 мы рассмотрели функцию Features on Demand (функции по требованию), предоставляющую возможность удаления с диска бинарных файлов неиспользуемых ролей и компонентов из каталога WinSxS. Для этого в Windows Server используется командлет PoweShell Uninstall-WindowsFeature.
В Windows 10 командлет Uninstall-WindowsFeature отсуствует, и для удаления компонентов Windows из образа нужно использовать DISM.
DISM в отличии от Uninstall-WindowsFeature не удаляет зависимые компоненты.
Полный список доступных функций в образе Windows 10 можно получить с помощью команды:
DISM.exe /Online /English /Get-Features /Format:Table
Чтобы удалить, например компонент TelnetClient с диска (из каталога WinSxS), выполните команду:
DISM.exe /Online /Disable-Feature /Featurename:TelnetClient /Remove
Если еще раз вывести список всех доступных функций по требованию в Windows, вы увидите, что статус компонента изменится на Disabled with Payload Removed.
Таким образом в Windows можно существенно уменьшить размер папки WinSxS, удалив с диска неиспользуемые компоненты. Единственный нюанс, это вариант очистки каталога WinSxS подойдет для достаточной продвинутых пользователей, которые разбираются в компонентах Windows 10 и их назначении.
Включаем NTFS сжатие на папке WinSxS в Windows
Еще один способ уменьшить размера каталога WinSxS в Windows 10 – сжать содержимое каталога на уровне файловой системы NTFS.
- Откройте командную строку с правами администратора;
- Остановите и отключите службы Windows Installer и Windows Module Installer:
sc stop msiserver sc stop TrustedInstaller sc config msiserver start= disabled sc config TrustedInstaller start= disabled
- Создайте резервную копию списков доступа (ACL) назначенных на файлы и папки в каталоге WinSxS с помощью утилиты icacls. Резервная копия ACL представляет собой обычной текстовый файл, в котором указаны все файлы и каталоги и назначенные на них NTFS разрешения (в дальнейшем этот файл понадобиться для восстановления оригинальных ACL):
icacls "%WINDIR%\WinSxS" /save "%WINDIR%\WinSxS_NTFS.acl" /t
- Назначьте себя владельцем папки WinSxS и всех вложенных каталогов:
takeown /f "%WINDIR%\WinSxS" /r
- Предоставьте своей учетной записи полные права на каталог WinSxS:
icacls "%WINDIR%\WinSxS" /grant "%USERDOMAIN%\%USERNAME%":(F) /t
- Теперь можно выполнить сжатие файлов в каталоге WinSxS с помощью команды compact. Т.к. часть файлов может использоваться Windows, нужно указать параметр /i. Иначе сжатие будет остановлено на первом же занятом файле (в Windows 10 можно использовать более прогрессивное LZX сжатие):
compact /s:"%WINDIR%\WinSxS" /c /a /i *
- Теперь нужно восстановить TrustedInstaller как владельца каталога WinSxS:
icacls "%WINDIR%\WinSxS" /setowner "NT SERVICE\TrustedInstaller" /t
- И вернуть оригинальные NTFS разрешения на каталог WinSxS из резервной копии ACL:
icacls "%WINDIR%" /restore "%WINDIR%\WinSxS_NTFS.acl"
- Измените типа тип запуска служб Windows Installer и Windows Module Installer:
sc config msiserver start= demand sc config TrustedInstaller start= demand
Проверьте текущий размер каталога WinSxS.
Как вы видите, в нашем примере размер папки WinSxS за счет сжатия уменьшился с 9,36 Гб до 6,5 Гб (примерно на треть). Неплохо, особо для небольшого по размеру SSD-диска.
Указанные команды можно выполнять по отдельности (так проще контролировать успешность выполнения каждой из них), либо можно объединить все операции в один файл скрипт. Вы можете скачать готовый bat файл для сжатия WinSxS здесь compress_winsxs.bat
Данный скрипт нужно запускать периодически, т.к. в каталоге WinSxS будут появляться новые «несжатые» файлы после установки новых обновлений Windows и программ.
На что может повлиять сжатие каталога WinSxS? Windows работает со сжатыми файлами в прозрачном режиме, однако при обработке таких файлов, ей может понадобиться дополнительное время на их декомпрессию/компрессию. Это может вызвать небольшое замедление при установке компонентов Windows или обновлений. Однако для современных процессоров (CPU) операция компрессии/декомпрессии файлов выполняется практически мгновенно, так что реального уменьшения скорости пользователь даже не заметит.
In this article we will talk about the WinSxS folder in Windows, the reasons for its constant growth, and ways to clean up it. The C:\Windows\WinSxS directory is the repository of Windows components. This directory contains DLLs, binary, and XML files necessary for the installation and operation of various Windows roles or features. When installing the Windows updates (usually this happens every month), the new version of the updated component is installed on the system, while the old one is saved to the WinSxS folder (it is necessary to provide compatibility and make it possible to rollback to the previous versions of the components when you uninstall the Windows update).
The WinSxS directory has grown in size over time. Moreover, its size is not limited by anything (although in practice the size of the WinSxS folder in Windows 10 rarely exceeds 15-20 GB).
Contents:
- How to Check the Actual Size of WinSxS Folder on Windows 10?
- How to Clean Up the Component Store (WinSxS folder) on Windows?
- Remove Unused Roles and Features from Windows 10/Windows Server
- How to Enable NTFS Compress on WinSxS Folder on Windows 10?
In this article, we’ll go over the safest ways to clean up the WinSxS folder on Windows 10 and Windows Server 2016/2019:
- Optimize the component store and remove old versions of Windows component files left after installing Windows updates;
- Features on Demand – allows you to remove unused Windows components from the disk;
- Enable NTFS compression on the WinSxS folder – a way to reduce the size of the WinSxS directory using the built-in compression of the NTFS file system.
Many users often ask: if it’s possible to manually delete files from the WinSxS folder. The answer is categorically NO! These actions can damage your Windows image. Though some attempts to remove files from the WinSxS folder can be successful, this method cannot be recommended.
How to Check the Actual Size of WinSxS Folder on Windows 10?
The easiest way to get the current size of the WinSxS folder on Windows is to open the properties of the %windir%\WinSxS
folder in File Explorer (or use a PowerShell script). But keep in mind that most file managers (including File Explorer) show a slightly larger WinSxS folder size than it takes on disk.
The fact is that the WinSxS directory contains a large number of hard links (symbolic links) to system files in other folders. File managers, when calculating the size of the WinSxS folder, take into account the size of files referenced by hard links, but this is not correct.
You can find out the real size of the WinSxS folder on disk using the du tool from Sysinternals:
du -v c:\windows\winSXS
You can also analyze the size of the component store (WinSxS folder) using the DISM command:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
Deployment Image Servicing and Management tool [==========================100.0%==========================] Component Store (WinSxS) information: Windows Explorer Reported Size of Component Store : 8.44 GB Actual Size of Component Store : 8.15 GB Shared with Windows : 5. 74GB Backups and Disabled Features : 1.97 GB Cache and Temporary Data : 438.31 MB Date of Last Cleanup : 2021-02-22 20:37:29 Number of Reclaimable Packages : 1 Component Store Cleanup Recommended : Yes The operation completed successfully.
As you can see, in this case, I can reduce the size of the WinSxS folder by (1,97 + 0,44) Gb.
How to Clean Up the Component Store (WinSxS folder) on Windows?
The fastest and easiest way to clear the Windows Component Store (the WinSxS folder) is to optimize the storage with the command:
Dism.exe /Online /Cleanup-Image /StartComponentCleanup
The StartComponentCleanup
DISM option is supported on all Windows versions starting from Windows 8 and Windows Server 2012.
After cleaning is complete, check the current size of the component store:
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
In my example, this reduced the size of the WinSxS folder by 2.4 GB.
The /StartComponentCleanup
option has an additional /ResetBase option that allows you to remove all previous versions of components left after installing Windows updates. After that, you won’t be able to remove installed updates or Service Packs, and the Uninstall button will disappear from the Uninstall an Update Control Panel item). To clean up old versions of components, run:
Dism.exe /Online /Cleanup-Image /StartComponentCleanup /ResetBase
In Windows 7 and Windows Server 2008 R2, an additional DISM option was used to clean up old versions of components that were left over after installing service packs.
DISM /online /Cleanup-Image /spsuperseded
You can also remove old update files using the “Disk Cleanup” wizard:
- Run the
cleanmgr
command as an administrator; - Select the disk and in the next window, click the “Clean up system files” button;
- Then select the “Windows update cleanup” option. The Disk Cleanup tool will show how much space you can free up by deleting old Windows update files. In my example, this is 324 MB. Click OK to start the cleanup.
After you finish cleaning up the component store using DISM, check how much disk space has been freed.
In addition, Windows 10/Windows Server 2016 Task Scheduler has a special automatic maintenance task that regularly optimizes and cleans up the WinSxS folder (same operation as DISM with StartComponentCleanup parameter). This StartComponentCleanup task is located under the \Microsoft\Windows\Servicing section of the taskschd.msc
. This task runs in the background and automatically removes component versions older than 30 days that have been superseded by newer files.
You can start this task manually like this:
schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"
Remove Unused Roles and Features from Windows 10/Windows Server
Features on Demand on Windows allows to remove binary files of the unused roles from the WinSxS folder. You can remove role and feature binaries on Windows Server using the Uninstall-WindowsFeature PowerShell cmdlet.
Windows 10 does not have the Uninstall-WindowsFeature cmdlet, and you must use DISM.exe to remove features from the Windows image.
Note that DISM, unlike the Uninstall-WindowsFeature
PowerShell cmdlet doesn’t remove dependent features.
A complete list of available features in Windows 10 image can be obtained using the command:
DISM.exe /Online /English /Get-Features /Format:Table
To remove, for example, the TelnetClient feature from the Windows image (from the WinSxS folder), run the command:
DISM.exe /Online /Disable-Feature /Featurename:TelnetClient /Remove
If you display the list of all on-demand features available in Windows, you will see that the component status has changed to Disabled with Payload Removed.
Thus, Windows allows to significantly reduce the size of the WinSxS folder by removing the unused components from the disk. The only thing is that this cleanup method suits only advanced users, who are familiar with the Windows 10 features and their purpose.
How to Enable NTFS Compress on WinSxS Folder on Windows 10?
Another way to reduce the size of the WinSxS directory on Windows 10 is to compress the directory contents on the level of the NTFS file system.
Note. As in case of any non-standard intervention into the system configuration, you are strongly recommended to create a full backup of your Windows 10 image.
- Open the command prompt as administrator;
- Stop and disable Windows Installer and Windows Module Installer services:
sc stop msiserver
sc stop TrustedInstaller
sc config msiserver start= disabled
sc config TrustedInstaller start= disabled - Let’s backup the Access Control Lists (ACLs) assigned to the files and folders in the WinSxS directory using the built-in icacls tool. A backup copy of an ACL is a plain text file that lists all files and directories and the NTFS permissions assigned to them (later this file will be needed to restore the original ACLs):
icacls "%WINDIR%\WinSxS" /save "%WINDIR%\WinSxS_NTFS.acl" /t
- Assign yourself as an owner of the WinSxS folder and all its subfolders:
takeown /f "%WINDIR%\WinSxS" /r
- Grant your account full control permissions on the WinSxS directory:
icacls "%WINDIR%\WinSxS" /grant "%USERDOMAIN%\%USERNAME%":(F) /t
- You can now compress files in the WinSxS directory using the compact command. Because some of the files can be used by Windows, you need to specify the
/i
option. Otherwise, compression will stop at the first locked file (in Windows 10, you can use more advanced LZX compression):
compact /s:"%WINDIR%\WinSxS" /c /a /i *
- Restore the owner of the WinSxS directory back to TrustedInstaller:
icacls "%WINDIR%\WinSxS" /setowner "NT SERVICE\TrustedInstaller" /t
- Restore the original ACLs for the WinSxS folder items using the ACL backup file you created earlier:
icacls "%WINDIR%" /restore "%WINDIR%\WinSxS_NTFS.acl"
- Restore the default startup type for the Windows Installer and Windows Module Installer services:
sc config msiserver start= demand
sc config TrustedInstaller start= demand
Now check the current size of the WinSxS folder:
As you can see, in our example the size of the WinSxS folder after the compression has reduced from 9.4GB to 6.5GB (about a third). Not bad, especially for a small-sized SSD drive.
These commands can either be run separately (then it is much easier to track the results of each of them) or used in a single script file. If you run it, the described compression procedure for items in the WinSxS folder will start. You can download the ready-to-use batch file to enable NTFS compression on WinSxS here: winsxs_ntfs_compress.bat
You can use this script regularly because new uncompressed files will appear in the WinSxS folder after you install new Windows updates or apps.
What can be affected by compressing the WinSxS folder? Windows works transparently with compressed files. However, when processing such files, it may take additional CPU time to decompress/compress them. This may cause a slight slowdown when installing Windows components or updates. However, on modern CPUs, the file compression/ decompression operations are performed almost instantly, so the user may not even notice the real impact on performance.
On Windows 10, «WinSxS» (Windows Side by Side) is an essential folder within the «Windows» folder, which houses most of the components to customize and update the current setup. For example, inside the WinSxS folder are the files to add or remove features, switch editions, recover damaged or missing system files, and pretty much everything else that makes up the operating system.
Also, when installing quality updates, the new components will store in the WinSxS folder, and the previous version of the components in case rolling back to an earlier build is necessary to deal with a buggy update. As a result, the folder will continue to increase its size over time without a set limit.
While the WinSxS folder is expected to grow over time, the actual size on the disk isn’t as big as it may seem. The problem is that most people would use File Explorer to calculate its size. Because the folder uses «hard linking,» a technique that allows the creation of pointers of an original file with entirely different names and locations in the same partition, they’ll appear as separate files to applications (such as File Explorer) reporting the wrong size.
If you try to free up space, you won’t be able to delete the WinSxS folder. However, it’s possible to reduce its size by deleting those files that are no longer required for Windows 10. You can accomplish this task using Command Prompt, Storage Sense, and even the legacy Disk Cleanup tool.
This guide will walk you through the steps to properly clean up the WinSxS folder to reclaim storage space on Windows 10.
How to reduce size of WinSxS folder using Command Prompt
Checking WinSxS folder size
To determine the actual size of the WinSxS folder, use these steps:
All the latest news, reviews, and guides for Windows and Xbox diehards.
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to determine the size of the WinSxS folder and press Enter: dism /Online /Cleanup-Image /AnalyzeComponentStore
- Confirm the reported size of the component store to see how much space the WinSxS folder is taking.
- Check the «Component Store Cleanup Recommended» information to determine whether cleanup is necessary.
Once you complete the steps, you’ll be able to determine the size of the Windows Side by Side folder and whether cleanup is recommended.
In addition, the command will return other useful information, such as how much of the components are shared with Windows 10 as well as the size for backups and disabled features, and the last time you used the cleanup tool.
Cleaning up WinSxS folder
To reduce the size of the WinSxS folder using Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to determine the size of the WinSxS folder and press Enter: dism /online /Cleanup-Image /StartComponentCleanup
After you complete the steps, the command will run to delete those components wasting space on the hard drive. However, once the WinSxS is clean, you won’t be able to roll back to a previous build until the next update.
If you want to determine how much space you have reclaimed using Command Prompt, you can re-run the command to analyze the folder and compare the «Actual Size of Component Store» values with the previous result.
How to reduce size of WinSxS folder using Storage Sense
To clean up the WinSxS folder with Storage sense, use these steps:
- Open Settings.
- Click on System.
- Click on Storage.
- Under the «Local Disk» section, click the Temporary files option.
- Quick tip: If you don’t see the item, click the Show more categories option to find it.
- Clear the default selection.
- Check the Windows Update Cleanup option.
- Click the Remove files option.
Once you complete the steps, the Windows Update Cleanup item will disappear from Storage sense, but it doesn’t mean that the WinSxS folder is no longer available. It’ll still be part of the «Windows» folder, but without the files that may unnecessarily be using space on the primary hard drive.
How to reduce size of WinSxS folder using Disk Cleanup
Alternatively, you can also shrink the size of the WinSxS folder with the legacy Disk Cleanup tool using these steps:
- Open File Explorer.
- Click on This PC from the left pane.
- Under the «Devices and drives» section, right-click the «Local Disk» drive and select the Properties option.
- Click the General tab.
- Click the Disk Cleanup button.
- Click the Clean up system files button.
- Clear the default selection.
- Check the Windows Update Cleanup option.
- Click the OK button.
After you complete the steps, the Disk Cleanup tool will delete all the temporary files found inside WinSxS, but without removing the folder.
While these instructions will help to reduce the footprint of WinSxS, the folder will eventually increase in size again as new updates and components become available. As part of the maintenance process, Windows 10 will reduce the folder size automatically, but you can always repeat the steps regularly to keep it as small as possible.
If you’re looking for other ways to free up space on Windows 10, check out this comprehensive guide with the best tips to delete temporary files from your computer.
More resources
For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:
- Windows 11 on Windows Central — All you need to know
- Windows 10 on Windows Central — All you need to know
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.
Table of contents
- What Is the WinSxS Folder?
- Can I Remove WinSxS On Windows 10?
- How to Check the Size of the WinSxS Folder
- How to Clean Up WinSxS
- Method 1: Use the task scheduler
- Method 2: Use DISM
- Method 3: Use disk cleanup
- Method 4: Use storage sense
- Method 5: Use a professional software
- Conclusion
Windows PCs can easily fill up with clutter that consumes valuable space, slowly affecting performance. The WinSxS folder is one location that holds many useless files that can be deleted to free up space on your computer.
However, how do you go about it, and is it even safe to do so? This article will explain how to clean the Winsxs folder in Windows 10.
Read on to learn.
What Is the WinSxS Folder?
WinSxS stands for side by side, as the folder contains different file versions stored together. It also contains crucial components to help update and customize the operating system.
So, it has the files involved in switching editions, recovering missing or damaged system files, adding or removing features, etc.
Can I Remove WinSxS On Windows 10?
You’re probably asking yourself, “Is it safe to delete WinSxS?” Well, deleting this folder would be a bad idea because the operating system needs the crucial components in it.
Therefore, deleting it would make it impossible for the operating system to perform some operations and cause problems. Windows update and booting issues are among the consequences you may experience.
However, the WinSxS folder also stores older operating system versions to make it easier to roll back. It does this with every system update, meaning it gets bigger over time.
Deleting these files would help free up space on your machine.
Windows 10 automatically scans this folder for the files it no longer needs and deletes them. However, you can manually delete the useless files if your PC runs out of space.
How to Check the Size of the WinSxS Folder
Windows allows you to check how much space the WinSxS folder uses on your PC. Follow these steps to do so:
- Use the
Windows key + S
combination to open the Windows search bar. - Type in command prompt and right-click the Command Prompt search result.
- Choose Run as administrator.
- Click the Yes button once the User Account Control prompt box appears.
- When the elevated prompt appears, type in the following command and then hit Enter:
dism /Online /Cleanup-Image /AnalyzeComponentStore
- Wait for the process to finish. The WinSxS folder’s size is under the Actual Size of Component Store section.
- You can also check the Component Store Cleanup Recommended section to see if the operating system recommends you clean up the WinSxS folder.
How to Clean Up WinSxS
There are different ways to clean the WinSxS folder in Windows 10. We will discuss the easiest ways to do so without causing system damage, so follow the instructions carefully.
Let’s jump right in.
Method 1: Use the task scheduler
The Task Scheduler enables you to delete useless files from the WinSxS folder quickly. Here is how to use it:
- Use the
Windows + R
key combo to bring up the Run dialog box. - Type in
taskschd.msc
and click on the OK button. - Use the left sidebar to navigate to the following location:
Task Scheduler Library\Microsoft\Windows\Servicing
- Once here, go to StartComponentCleanup on the right pane.
- Then go to the Actions section and click on the Run button.
- The Task Scheduler will start cleaning the WinSxS folder. Wait for the process to finish.
Method 2: Use DISM
The Deployment Image Servicing and Management tool helps repair corrupted system images in Windows. However, you can also use it to clean the WinSxS folder.
Follow these instructions to use this tool:
- Open the search bar using the
Windows + S
keyboard shortcut. - Type in command prompt and then choose Run as administrator on the right menu pane.
- Select Yes on the UAC window.
- Type in this command and hit Enter.
Dism.exe /online /Cleanup-Image /StartComponentCleanup
- Wait for it to finish and then close the Command Prompt.
Method 3: Use disk cleanup
Disk cleanup is a legacy tool that allows you to check for useless files on your machine and delete them.
Here is how to use it to clean up the WinSxS folder:
- Press the
Windows key + E
combination to open the File Explorer. - Select This PC on the left menu pane.
- Right-click on Local Disk (C:) and choose Properties.
- Go to the General tab and click the Disk Cleanup” button at the bottom.
- Head to the “Files to delete” section and select checkboxes for the files you want to delete. Then click on the OK button.
- If you want to free up more space, click on the Clean up system files button.
- Select the checkbox for Windows Update Cleanup and other files you want to delete.
- Finally, click on the OK button.
Related: Disk Cleanup Tips: How to Compress a Drive to Save Disk Space in Windows 10
Method 4: Use storage sense
The other simple way to clean up the WinSxS folder is through storage sense in Windows 10. Use these instructions:
- Right-click on the Windows button in the screen’s bottom-left corner and choose Settings.
- Go to System.
- Choose Storage under System on the left pane.
- Head to the Local Disk C section and click on Temporary files. If you can’t see that option, click on the Show more categories link.
- Clear the selected checkboxes and choose Windows Update Cleanup.
- Once done, click on the Remove files button at the top of the window.
Method 5: Use a professional software
Use a professional PC cleaner to thoroughly scan your computer for useless files and effectively remove them. A good example we recommend is Auslogics Windows Slimmer.
This unique app scans your computer for disabled components, old System Restore points, outdated Windows libraries, and Windows update files and automatically deletes them.
It also lets you tweak your machine’s settings to help boost performance.
Therefore, if you feel like your regular PC scans don’t remove all the clutter from the system, this tool is what you need. It has a user-friendly user interface, so you can download it and start using it today.
Download Auslogics Windows Slimmer
This tool cleans your PC from unneeded components and applications to make your Windows system more compact and efficient.
Conclusion
Have you been wondering, “Why is WinSxS so big?” If yes, we hope this article has helped you understand how to clean the WinSxS folder to ensure it doesn’t waste valuable storage space.
However, if you still have questions regarding today’s post, feel free to leave a comment below. Also, check out our blog for more helpful Windows 10 guides like this one.
Table of Contents:
When searching for disk space hogs, users often come across the WinSxS folder, a seemingly hefty file that Windows Explorer tells them is 8GB+ and contains tens of thousands of files. They’ll quickly find there’s no way to delete WinSxS entirely (for good reason) but it is possible to clean WinSxS to free up some space.
What is WinSxS?
The WinSxS folder, also known as the component store, holds all essential Windows components. Though you may see such components elsewhere in Windows 10, in reality, they’re just links back to WinSxS, which handles the heavy lifting.
As a result, deleting WinSxS would not be good. There’s a good chance your system would be unable to boot, and as WinSxS also contains backups of older component versions, you may not be able to repair, either.
However, that’s not to say the Windows SxS folder doesn’t contain files you don’t need. It keeps older versions in case you need to roll back to an older version of Windows 10, which means it grows with each Windows Update. If you’re happy with your system stability, it’s possible to perform a WinSxS folder cleanup and regain some space.
Generally, Windows 10 is quite good at doing this automatically, but if you need space right now, you may not have time to wait for its scheduled maintenance. We’re going to show you how to safely clean WinSxS so you can get your system running smoothly again.
How to Cleanup WinSxS in Windows 10 with Task Scheduler
The most user-friendly way to clean WinSxS is Windows 10’s built-in Task Scheduler app.
- Open Task Scheduler
Press “Windows + R” to open the ‘Run’ dialog, type “taskschd.msc”, and press “Enter”.
- Navigate to the Windows Servicing folder and run WinSxS folder cleanup
Using Task Scheduler’s left sidebar, make your way to
Task Scheduler Library\Microsoft\Windows\Servicing
. Find “StartComponentCleanup” and click “Run”. - Wait for the Windows Component Clean tool to run
The Windows Component Clean tool when then start to clear up your files, which you’ll note when the status in Task Scheduler changes from “Ready” to “Running”. It may take some time to fully complete.
How to Cleanup WinSxS with the StartComponentCleanup Command
The Command Prompt is often a faster way to get things done. Those familiar with the tool or without UI access can perform a WinSxS folder cleanup via two DISM methods. The first gives similar results to the Task Scheduler:
- Open an elevated Command Prompt
Press the “Start” button and type “Command Prompt”. Windows will automatically select the program and you can click “Run as administrator”.
- Run the Windows Component Clean tool from the command-line
Type the command
Dism.exe /online /Cleanup-Image /StartComponentCleanup
and press “Enter”. It will return a progress bar. Wait for it to finish and close the window when ready.
How to Clean up the Component Store and Delete All Old Component Versions
If you’d like a little more space and are happy to risk being unable to roll back, you can also use DISM to delete all older Windows component versions. Doing so will mean you’re unable to uninstall updates.
- Open an elevated Command Prompt
Press the “Start” button and type “Command Prompt”. Windows will automatically select the program and you can click “Run as administrator”.
- Run the WinSxS clean up tool with the Reset Base command
Type the following command:
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
Press “Enter” and wait for it to complete.
How to Clear Service Pack Backup Components via DISM
Those who are on older Windows versions can also remove backups of Service Pack components that are retained in case of uninstallation. As Windows 10 doesn’t have Service Packs, this won’t be necessary for most people.
- Open an elevated Command Prompt
Press the “Start” button and type “Command Prompt”. Windows will automatically select the program and you can click “Run as administrator”.
- Enter the WinSxS Service Pack Clean Command
In the Command Prompt window, type the following and press “Enter”:
Dism.exe /online /Cleanup-Image /SPSuperseded
Wait for it to finish and close Command Prompt.
How to Perform an Extended Disk Cleanup to Free Up More Space
You can reduce your Windows Component size and delete other unnecessary Windows 10 files via the Disk Cleanup tool. Here’s a full tutorial, or you can read our quick guide below:
- Open an elevated Command Prompt
Press the “Start” button and type “Command Prompt”. Windows will automatically select the program and you can click “Run as administrator”.
- Run the cleanmgr command and free up space
In the command window, type the following and press “Enter” on your keyboard.
cmd.exe /c Cleanmgr /sageset:65535 & Cleanmgr /sagerun:65535
Windows 10 will then launch the Extended Disk Cleanup tool. Tick the files you’d like to remove, including “Windows Update Cleanup” if you want to delete WinSxS files. Wait for the process to complete, keeping Command Prompt open while it does so.
Ryan Maskellhttps://ryanmaskell.co.uk
Ryan has had a passion for gaming and technology since early childhood. Fusing the skills from his Creative Writing and Publishing degree with profound technical knowledge, he enjoys covering news about Microsoft. As an avid writer, he is also working on his debut novel.