Home / Solution / WinSxS Folder: Clean Up and Compress in Windows 10 and 8.1

WinSxS Folder: Clean Up and Compress in Windows 10 and 8.1

In this text we are going to speak concerning the WinSxS folder in Windows 10 and Windows 8.1, the explanations of its fixed development and methods to wash up it. The C:WindowsWinSxS listing is the repository of Windows elements. This listing accommodates DLLs, binary and XML information obligatory for set up and operation of any Windows roles or options. When putting in the Windows updates (standard this occurs each month), the brand new model of the up to date element is put in in the system, whereas the previous one is saved to the WinSxS folder (that is obligatory to offer compatibility and make it attainable to roll again to the previous variations of the elements if you uninstall the problematic replace).

Over time, the WinSxS listing is continually growing, and its measurement just isn’t restricted by something (though in follow the scale of the WinSxS folder in Windows 10 / 8.1 hardly ever exceeds 15-20 GB.)

winsxs folder in windows 10

The best option to cut back the scale of the WinSxS folder in Windows 10 and Windows eight is to take away the previous variations of the elements remaining after the system replace. To do that, you need to use the usual disk cleanup wizard (cleanmgr.exe) or particular choices of the DISM command (see beneath).

Tip. In Windows 7 SP 1, you possibly can delete previous replace information utilizing the disk-cleaning utility solely after putting in a separate replace – KB 2852386.

How to Check the Actual Size of WinSxS Folder in Windows 10 / 8.1

Another characteristic of the WinSxS folder is a large quantity of symbolic onerous hyperlinks in it. A tough hyperlink is a pointer to a file that’s utterly equal to the unique. That implies that a pointer and a supply file can have completely different names and are situated in completely different directories of the identical quantity, however they level to the identical object. It is because of onerous hyperlinks, considered when calculating the full measurement of the folder, that the file managers (together with Windows Explorer) present a bit exaggerated measurement of the WinSxS folder. You can discover out the true measurement of the WinSxS folder-using du utility from Sysinternals:

 du -v c:windowswinSXS

get winsxs folder real size with DU

You may also analyze the scale of the element storage (WinSxS folder) utilizing the DISM command:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

Dism.exe Cleanup Image AnalyzeComponentStore

Deployment Image Servicing and Management device
[==========================100.0%==========================] Component Store (WinSxS) info:
Windows Explorer Reported Size of Component Store : 7.00 GB
Actual Size of Component Store : 6.86 GB
Shared with Windows : four.58 GB
Backups and Disabled Features : 1.86 GB
Cache and Temporary Data : 419.85 MB
Date of Last Cleanup : 2018-08-02 03:15:12
Number of Reclaimable Packages : 1
Component Store Cleanup Recommended : Yes
The operation accomplished efficiently.

As you possibly can see, in this case, I can cut back the scale of the WinSxS listing by (1,86 + zero,42) Gb.

Many customers generally ask: is it attainable to manually delete information from the WinSxS folder. The reply is categorically NO! These actions are prone to outcome in injuring the Windows picture health. Though some makes an attempt to take away information from the WinSxS folder could be profitable, this methodology can’t be advisable because of its potential hazard to the system.

Let’s dwell on essentially the most security methods of cleansing up the WinSxS folder in Windows 10 and 8.1. These are:

  • Removing previous variations of elements from element retailer (remaining after putting in updates);
  • Features on Demand – that enable to take away the unused Windows options from the disk;
  • WinSxS folder compressing – a option to cut back the scale of the WinSxS listing utilizing the NTFS compression.

To attain the most effective outcome, you need to use all 3 ways collectively.

Clean Up Component Store (WinSxS folder) in Windows 10 / 8.1

In my opinion, the quickest and best option to clear the element retailer (the WinSxS folder) is to run the DISM command:

Dism.exe /Online /Cleanup-Image /BeginComponentCleanup

The /BeginComponentCleanup choice has an extra /ResetBase choice that permits you to take away all earlier variations of elements (after that you simply won’t be able to take away put in updates or Service Packs, and the Uninstall button will disappear from the Uninstall an Update Control Panel merchandise). The command seems to be like this:

Dism.exe /Online /Cleanup-Image /BeginComponentCleanup /ResetBase

You may also take away previous replace information utilizing the “Disk Cleanup” wizard:

  1. Run the cleanmgr command as an administrator;
  2. Select the disk and in the following window, click on the “Clean up system information” button;Clean up system files
  3. Then choose the “Windows replace cleanup” choice. The Disk Cleanup utility will present how a lot area you possibly can unlock by deleting previous Windows replace information. In my instance, that is 324 MB. Click OK to start out the clear up.Windows update cleanup using cleanmgr tool

In addition, in the Windows 10 activity scheduler there’s a particular computerized upkeep activity that performs the identical operation as DISM with the BeginComponentCleanup choice. This activity removes all outdated updates older than 30 days. This activity, named BeginComponentCleanup, is situated in the MicrosoftWindowsServicing part.

StartComponentCleanup task

Features on Demand in Windows

In the article «Safe Clean Up of the WinSxS Folder in Windows Server 2012» we regarded on the new choice Features on Demand, that enables to take away binary information of the unused roles information from the WinSxS folder. To take away the unused roles from the disk, there’s a particular PowerShell cmdlet – Uninstall-WindowsFeature. The factor is that there is no such thing as a Uninstall-WindowsFeature cmdlet in Windows 10 and 8.1. You can implement Features on Demand technology solely utilizing DISM or DISM PowerShell cmdlet. Moreover, it’s necessary to know that DISM command in distinction to Uninstall-WindowsFeature cmdlet doesn’t analyze bundle dependencies. So, after eradicating a Windows bundle utilizing DISM solely the element specified in the command shall be eliminated and all dependent packages will stay in the system. This is the rationale why DISM shouldn’t be used to take away function information from the disk in Windows Server 2012/R2, since there’s a extra handy and practical option to do it.

An entire record of accessible options in a Windows 10 /8.1 picture could be obtained utilizing the command:

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

DISM Get-Features list

Let’s suppose, for example, that we received’t want TelnetClient feauture. Remove this element from the disk (basically from the WinSxS listing) utilizing the command:

DISM.exe /Online /Disable-Feature /Featurename:TelnetClient /Remove

DISM Disable Feature Remove

If you show the record of all capabilities out there in Windows, you will notice that the element standing has modified to Disabled with Payload Removed.

Thus, Windows permits to considerably cut back the scale of the WinSxS folder by eradicating the unused elements from the disk. The solely factor is that this cleanup methodology fits just for the superior customers, who’re accustomed to the Windows 10 elements and their objective.

How to Enable NTFS Compress on WinSxS Folder in Windows 10 and 8.1

Another option to cut back the scale of the WinSxS listing in Windows 10/8.1 is to compress the listing contents on the extent of the NTFS file system.

Note. As in case of any nonstandard intervention into the system configuration, you’re strongly advisable to carry out a full system backup.

    1. Open the command immediate as administrator;
    2. Stop and disable Windows Installer and Windows Module Installer companies:
      sc cease msiserver
      sc cease TrustedInstaller
      sc config msiserver begin= disabled
      sc config TrustedInstaller begin= disabled
    3. Let’s again up the entry lists (ACLs) assigned to the information and folders in the WinSxS listing utilizing the icacls utility. A backup copy of an ACL is a plain textual content file that lists all information and directories and the NTFS permissions assigned to them (this backup will turn out to be obligatory when recovering authentic ACLs):
      icacls "%WINDIR%WinSxS" /save "%WINDIRpercentWinSxS_NTFS.acl" /t

      icacls - backup winsxs ACL

    4. Assign your self as an proprietor of the WinSxS folder and all its subfolders:
      takeown /f "%WINDIR%WinSxS" /r
    5. Grant your account full management permissions on the WinSxS listing:
      icacls "%WINDIR%WinSxS" /grant "%USERDOMAIN%%USERNAME%":(F) /t
    6. Compress the contents of WinSxS listing utilizing the compact command. Some information can be utilized (locked) by the system, so when you run this command with out /I parameter, the compression will cease on the first file presently utilized by the system. You can discover the identify of the method that has opened this file utilizing the Process (CTRL+F) and kill it. We solely restrict ourselves to compressing unused information (in Windows 10, you need to use extra superior LZX compression):
      compact /s:"%WINDIR%WinSxS" /c /a /i *

      compress winsxs folder with compact utility

    7. Restore the proprietor of the WinSxS listing again to TrustedInstaller:
      icacls "%WINDIR%WinSxS" /setowner "NT SERVICETrustedInstaller" /t
    8. Restore authentic ACLs to the WinSxS listing from the ACL backup file:
      icacls "%WINDIR%" /restore "%WINDIRpercentWinSxS_NTFS.acl"

      winsxs ntfs compress complited

    9. Restore the startup of Windows Installer and Windows Module Installer companies:
      sc config msiserver begin= demand
      sc config TrustedInstaller begin= demand

Now examine the scale of the WinSxS folder:

size of winsxs folder

As you possibly can see, in our instance the scale of the WinSxS folder after the compression has lowered from 5.8GB to 4GB (a couple of third). Not unhealthy, particularly for a small-sized SSD-drive, the place on which is sort of costly.

These instructions can both be run individually (then it’s a lot simpler to observe the outcomes of every of them) or used in a single script file. If you run it, the described compression process of the WinSxS folder will begin. You can obtain the ready-to-use batch file right here: winsxs_ntfs_compress.bat

This script can be utilized recurrently throughout system operation, as a result of after new updates or functions have been put in, new uncompressed information will seem in the WinSxS folder.

What might have an effect on the NTFS compression of the WinSxS listing?

Windows works with compressed information in the clear mode. However, it could actually take some further time to compress/decompress it, which implies that the element or replace set up processes can turn out to be considerably sluggish. However, on fashionable CPU, the file compression / decompression is carried out virtually immediately, so the person might not even discover an actual efficiency discount. Moreover, in case your HDD is sluggish, and the processor is quick sufficient, with compression you possibly can even discover a rise in the velocity of working with the disk! We ought to observe that when the entire contents of the WinSxS folder is compressed, numerous information in another system directories can even flip to be compressed as a result of onerous hyperlinks.

Note. You can discover in the net one other script that enables to scale back the scale of the WinSxS folder— WinSxSLite (by Christian Bering Boegh). According to the developer, this script searches the latest library information on the disk, makes hyperlinks to them from all earlier variations and deletes previous variations. We don’t suggest our readers to make use of WinSxSLite, as a result of in spite of the concept being good, the results of operating the script is unpredictable and although the WinSxS folder is lowered, some Windows performance turns into unavailable.

Check Also

Configuring Storage Replica on Windows Server 2016

A fairly attention-grabbing characteristic, Storage Replica (SR), appeared in Windows Server 2016 that permits to …

Leave a Reply

Your email address will not be published. Required fields are marked *