TVs. Consoles. Projectors and accessories. Technologies. Digital TV

What does the winsxs folder contain? WinSxS what is this Windows folder, how to clean it? Removing Windows components

The capacity of modern hard drives reaches several terabytes, but even such a drive can be filled to capacity over time. And when there is little left on the disk free space, the user begins to look for ways to increase it. Any methods are used, starting from transferring data to removable media and ending with deleting system ones, which, by the way, is not recommended. In general, freeing up disk space by deleting files created by the system is a delicate matter and requires considerable caution from the user.

So, on the Internet you can find tips on increasing disk space by cleaning system folder WinSxS. Since this directory tends to grow, there really is a point in cleaning it (there were users whose size reached several tens of gigabytes), but again, maximum caution must be exercised here and if you clean this folder, do it correctly. We will look at methods for such cleaning, but before that, let’s find out what kind of WinSxS folder this is and whether it is really needed.

What is the WinSxS folder for?

The WinSxS directory first appeared in Windows Vista. It contained configuration files of the system and its components; later other system files were added to it, which, however, did not change its original purpose. In Windows 7, 8.1 and 10, the WinSxS folder stores backups system files, automatically created when installing major and cumulative updates, thanks to which the user can roll back to the previous one Windows versions, if he doesn’t like the new one or some bugs are found in it.

Since updates are installed regularly, WinSxS increases in size, which, of course, cannot but bother particularly meticulous users. And here the questions begin: is it possible to remove WinSxS, if so, how to do it, whether this will affect the operation of the system, etc. Let's start with the fact that you can remove anything, but the results of such cleaning can be disastrous. The WinSxS folder stores not only backup copies of previous versions of the system, but also the data necessary to reset it to its original state. It also contains shared files with the Windows directory, cache and temporary system files, and if the latter can still be cleared without any consequences, then deleting the former may well lead to Windows not booting at all.

How to clean WinSxS in Windows 7/10 without damaging the system and is there a need for such cleaning at all? The last question is quite reasonable, since the true size of WinSxS may differ from what is shown by Explorer or another file manager.

The reason for this is simple: approximately 40 percent of the contents of the WinSxS folder are represented by symbolic links to objects in Windows directory, displayed and identified as real files, but without any weight. Of course, you need to understand that this ratio is very conditional; it changes as the folder grows due to backup copies.

WinSxS optimization methods

Before you start cleaning WinSxS, it is highly advisable to establish its exact size - in case it does not take up as much space as it seems. Open as administrator command line and run this command:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

The analysis will take some time.

Upon completion of the operation, pay attention to the “Actual component storage size” parameter; its value will be the true size of the WinSxS folder. Moreover, the Dism utility itself will determine whether it needs to be cleaned or not. In the example presented here, cleaning is not required; your situation may be different. But let's return to the topic of how to clean the WinSxS folder.

Cleanmgr

The most obvious way involves using the built-in utility cleanmgr. Run it through the “Run” window and click the “Clean up system files” button.

Find and check the "Cleaning" Windows updates" and click "OK". If you don’t have this item, then there’s basically nothing to clean.

Job Scheduler

The WinSxS folder can also be cleaned through the Task Scheduler. Open this tool with the command taskschd.msc, and then expand the branch in the left column Microsoft - Windows - Servicing.

Highlight the StartComponentCleanup task and click Run. By the way, Scheduler-controlled cleaning runs automatically every 30 days in background.

Dism

The disadvantage of the above methods is that the estimate of freed up space can be very approximate and can vary up to several hundred megabytes in both directions. In addition, when cleaning through the Scheduler, updates installed in the last 30 days are ignored. If you want to get better results, use the utility Dism. With an elevated Command Prompt or PowerShell open, run the following command:

Dism.exe /online /Cleanup-Image /StartComponentCleanup

Launched with these Dism parameters does the same thing as cleanmgr, but is more accurate in determining the amount of space to be freed.

To perform a deep clean and remove archived update component files, use the following command:

Dism.exe /online /Cleanup-Image /SPSuperseded

Remember, however, that after running this command you will no longer be able to roll back to the previous version of Windows 7/10, as all backups will be deleted. By the way, if no saved update packages are found, you will receive a message as in the attached screenshot.

Instead of the above command, you can also use another one that cleans up old packages for each component:

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

Automatic cleaning via Scheduler

If necessary, cleaning the WinSxS folder can be automated using the Task Scheduler. To do this, you need to create a new task and on the “General” tab, check the “Run with highest rights” checkbox.

Next, in the action creation window, select the “Run a program” action, enter Dism.exe in the “Program or script” field, and insert the line (keys) taken from the above commands in the “Add arguments” field.

Finally, in the “Triggers” tab you will need to specify the time and frequency of the operation.

How else to reduce the size of WinSxS in Windows 7/10

In conclusion, we will look at another way to clean the WinSxS folder, however, the word “cleaning” is not entirely appropriate here, since we are talking about deleting not temporary data, but unused components supplied with the Windows distribution. If you open the classic “Programs and Features” snap-in and click there on the “Turn on or off” link Windows components", you will see that not all system components are included.

But even when disabled, they are still on the disk, located exactly in the WinSxS folder. By deleting them, you can free up some extra disk space. To do this, we will again use the console utility Dism. Launch the command line as administrator and first run the following command:

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

A list of components indicating their status will be immediately displayed in the console. Disabled means disabled, Enabled indicates the component is enabled. To remove an unnecessary one, run the following command:

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

Here Name is the name of the component taken from the list obtained above.

If the utility asks you to reboot, enter Y, press enter and reboot. The component will be removed. The method is reliable, effective, and most importantly safe.

And one last thing. You should not abuse cleaning the WinSxS folder. If its size does not exceed 10 GB, then there is no need to rush with the revision, and the resulting 2-3 GB will not make a difference. If you really don’t have enough space on the system partition, it’s better to expand the volume and not let the disk become critically full with files.

Hi all! Today we’ll talk, or rather, raise a sore topic that will tell us the secret of the strangeness with the C drive, or rather, when on some day you get an error Not enough space on drive C, then WTF you say, I haven’t installed anything for the last half a year, where those 30-50 gigabytes that I saw on drive C could have disappeared. If you are faced with this situation, then you have found the article that will help you find your precious gigabytes)) )

How to free up disk space with

For the last two weeks a message has been popping up, “that there is not enough space on drive C”: and the operating system was updated, but we just couldn’t get around to figuring it out! And I decided to check what was eating up my disk space so much. Took advantage free program Scanner and found out what my disk is doing! I cleaned out the folders, but one folder caught my attention and we’ll talk about it now.

WinSxS folder

What is the WinSxS folder?! This folder is for storing backups system files operating system before updates. And now in simple language- when you install new Windows updates, old versions of files are stored in this folder so that you can “roll back” to old versions.

As you can understand, over time this folder grows to several tens of gigabytes, and in this article we will analyze its cleaning for Windows 7 and Windows 10.

Cleaning the WinSxS folder in Windows 7

Go to “My Computer”, right-click on the system drive (in most cases this is the C:\ drive), select “Properties”, then select “Disk Cleanup”

The cleaning program will estimate the amount of space that can be freed up! Here you can select other files that can be deleted, but we are interested in “Cleaning system files”. After assessing the space, check the boxes for “Update package backup files” and “Temporary files”

The program will ask for confirmation to delete files, click OK and the deletion process will begin.

If suddenly you do not have the “Disk Cleanup” item in the properties of the system disk, you need to install an optional update in “Windows Update” KB2852386

How to empty the WinSxS folder in Windows 10

Unlike Windows 7, in Windows 10 the WinSxS folder stores not only files related to updates, but also files of the system itself used during operation. As well as system files in order to return the OS to initial state or perform some recovery-related operations.

Do not delete the WinSxS folder in Windows 10 manually!

And so, how to delete a folder painlessly:

  1. Run Command Prompt as Administrator
  2. Enter the command

    Dism.exe /online /cleanup-image /AnalyzeComponentStore

    and press Enter.

The system will analyze the component storage and display the result of its cleaning (needed or not)

So, every time you run the Disk Cleanup utility, for some reason the contents of the %WinDir%\System32\DISM folder are copied to the %LocalAppData%\Temp\(GUID) folder (and the temporary folder is not deleted after the operation is completed). Then, using the updated DLL, a programmatic call to the deep cleaning function is made directly from the utility. However, copying of the DISM folder was observed even before the release of KB2852386.

Ambiguities

There is reason to believe that the cleaning algorithm in Windows 7 is not exactly the same as in Windows 8 and higher with the /StartComponentCleanup key. In particular, for me and for the readers not revealed yet file compression, despite the identity of the text description in the cleanmgr utility. Check it out for yourself and write in the comments!

Another incomprehensible nuance is a mysterious phrase in the knowledge base article (translation is mine):

Therefore, after you run the Disk Cleanup wizard, you may be unable to roll back to a superseded update.
After wiping your disk, you may not be able to roll back to an update that has been replaced by a more recent one.

And nowhere is it explained what this feature depends on :) In my experiment, all updates retained the ability to remove them, as it should be when using the /StartComponentCleanup key in Windows 8 and newer. Perhaps over time, specifics will appear...

Finally, it is not entirely clear what prevented this from being implemented earlier, and why the update appeared now. By the way, there are no plans yet to transfer cleaning to the DISM.exe utility of Windows 7, which does not allow processing offline images. Perhaps such a transfer reveals a whole layer of support issues related to image maintenance.

How to automate cleaning of the WinSxS folder

In Windows 8, cleaning is assigned to a separate scheduled task, and as a last resort, you can use the command line utility DISM.exe. In Windows 7, the only method currently available is to create a customized configuration for the Disk Cleanup utility and add the resulting command to the scheduler.

Folders with compressed files are marked in blue. So far I have not seen a single fact of compression in Windows 7.

Why is the command not working? DISM /Online /Cleanup-Image /StartComponentCleanup?

Because it is for Windows 8 and newer. On Windows 7, use Disk Cleanup following the instructions in this article.

To be continued…

Discussion

I have approximately the same questions for you as after the publication of a similar article about Windows 8. But given the high percentage Windows owners 7, I expect to see more answers :)

Please, write in the comments:

  1. Did you manage to optimize the WinSxS folder?
  2. How much space did you save (you can convert bytes to gigabytes

Careful users may find that system disk in Windows 7, 8.1 and 10 there is a rather large WinSxS folder, the size of which only increases over time. What is this folder, what is stored in it and how to clean it?

What is the WinSxS folder in Windows?

Initially, the WinSxS folder was intended as a directory for storing system update files. For example, if you want to roll back an installed update in Windows 7, during the process the system will use temporary files stored in WinSxS. Accordingly, when installing system updates, the WinSxS folder becomes larger and larger - after all, you need to save data about all changes. In Windows times 7 no one thought about it - the system only worked on full-fledged computers, where there are problems with the availability of free internal memory there wasn't.

With Windows 8.1 came the era of SSD hard drives, as well as tablets and transformers. Many users with only 32/64 GB of internal memory began to monitor the status of the drive more closely, and the WinSxS folder could not pass their attention. The mechanism for filling it out remained the same - the system simply saved all the data about installed updates, which in a year or two could accumulate up to 15 GB. Microsoft, like users, could no longer ignore this trend, and several mechanisms for cleaning up this folder were added to Windows 8.

All cleaning methods have migrated from Windows 8.1 to Windows 10. However, in the new operating system Microsoft's WinSxS folder has received several new features. Now it is also used by some system mechanisms. And, by the way, any functions backup and restores in both Windows 8 and Windows 10 are linked to the WinSxS folder.

Why does the WinSxS folder take up a lot of space?

As we noted above, the WinSxS folder becomes larger and larger with each system update. But initially it is not so small - even after installing the system, the volume of the directory can range from several hundred megabytes to several gigabytes. Why is WinSxS so big and takes up a lot of space?

Firstly, starting from Windows 8, the WinSxS folder contains some system files and components, including critical ones. Secondly, the WinSxS folder is actually smaller than it seems. The fact is that it contains many links to files in Windows directories. Explorer, for example, considers links as files themselves, so the actual volume of WinSxS will differ from what is displayed in its properties.

How to delete the WinSxS folder

No way. Deleting the folder will cause your system to never boot again. This is due to the fact that it stores, among other things, critical system files.

How to empty the WinSxS folder in Windows 7

In Windows 7, there is only one way to empty this folder.

  1. Make sure you have the KB2852386 update installed.
  2. Open menu Start, further All programs.
  3. Find the folder Standard.
  4. Right click on the program Command line and select Run as administrator.
  5. Enter the command cleanmgr and press Enter.
  6. Check the box Cleaning Windows Updates and press OK. If there is no such checkmark, then there is nothing to clear.
  7. Restart your computer.

How to determine the size of the WinSxS folder in Windows 10 and 8.1

We wrote above that Explorer determines the size of the WinSxS folder incorrectly. Fortunately, the system has a mechanism for correctly measuring the volume of WinSxS.

Let's figure out what numbers mean what.

  • Component storage size according to File Explorer- most often the folder size displayed by Explorer is incorrect.
  • Actual Component Store Size- the correct volume of the folder, which is calculated without taking into account links to the Windows directory.
  • Shared with Windows- the volume of critical system files contained in the WinSxS folder.
  • Backups and disabled components- the volume of files intended for rolling back components to previous versions, as well as for activating disabled components. Not critical for system operation.
  • Cache and temporary data- the volume of files that are used to speed up the system. Not critical to her work.

On a “clean” system that was recently installed, the folder size according to Explorer and the actual size may be the same. Moreover, most of the files in the WinSxS folder may be critical system files. However, after installing several updates, the situation will change.

The command line will also provide information about the date of the last cleanup and a recommendation whether to perform a manual cleanup or not. However, you can decide for yourself whether it needs to be carried out - there will be no harm from it.

Cleaning the WinSxS folder in Windows 10 and 8.1

The methods for cleaning the WinSxS folder in Windows 8.1 and Windows 10 are the same and will work on every operating system. There are four of them in total:

  • Using the utility Disk Cleanup. This process is similar to emptying a folder in Windows 7. It may not be very accurate - errors in estimating the size of deleted or compressed files sometimes amount to several hundred megabytes.
  • By mechanism DISM. This method will be the best.
  • By using DISM with the removal of previous versions of components. You won't be able to roll back feature updates or go back to a previous version of the system, but more space will be freed up.
  • Using the utility Job Scheduler. It works almost the same as DISM, but sometimes it may not start. Additionally, temporary files created in the last 30 days are not deleted. You can also set up automatic cleaning.

Let's look at them one by one.

How to clean up the WinSxS folder in Windows 10 and 8.1 using the Disk Cleanup utility

Cleaning WinSxS on Windows 10 and 8.1 using DISM

How to clean WinSxS in Windows 10 and 8.1 using DISM and removing previous versions of components

We warn you once again that such cleaning will deprive you of the ability to roll back versions of components and the system. In case Microsoft accidentally releases a Windows 10 cumulative update with critical bugs, and you perform this operation after installing it, return to previous version The OS will fail.

Cleaning the WinSxS folder in Windows 8.1 and Windows 10 using the Task Scheduler utility

As we noted above, this mechanism is almost similar to DISM. A nice addition is the ability to customize automatic start cleaning.

You can simply run the task right now:


You can also set it to run automatically, for example, when the computer is not in use:


Now you know why the WinSxS folder is needed, why it is so large, and how to clean it up in Windows 7, Windows 8.1 and Windows 10.

While using the OS, users notice the rapid growth of the Windows folder. The increase in size is due to the fact that the internal winsxs folder begins to weigh a lot. Let's figure out what this winsxs folder is in Windows 7, 10, 8 and whether it can be deleted or cleaned.

Winsxs - what is this folder and can it be deleted?

This folder is located along the path C:\Windows\winsxs and stores OS component files, as well as backups and updates to these files. Even if these components are not installed on the operating system, they are stored in the winsxs folder, taking up HDD space.

Note: In these circumstances, the local drive letter is C. Your letter may be different, be careful.

In fact, the OS components are located in other places, and the contents of the winsxs folder are links to these components. When Windows updates are installed, they and their old copies end up in the winsxs folder. Over time, there are more and more updates and, accordingly, the winsxs folder takes up a lot of space in Windows.

The winsxs folder can reach several gigabytes in size. Although for modern hard drives this free space doesn’t mean anything, but it won’t be superfluous. To find out how much winsxs weighs, just right-click on it, then select “properties”, and on the “general” tab look at the number of megabytes. This method will not give information about the actual size of the folder, but will help judge the amount of free space. Remember this number, you will need it in the future for comparison.

Important! It is immediately necessary to make a reservation that deleting the winsxs folder in Windows manually in the traditional way does not make sense, since you can remove components vital for the operation of the system.

Cleaning programs will not work, they remain regular means OS that will help clean up the winsxs folder in Windows. Let's look at the methods in more detail.

Removing old updates using the Disk Cleanup utility

This method works in Windows 7 and older, which will reduce the size of the winsxs folder. Run Disk Cleanup using one of the following methods:

In the new window, click the clean system files button (shown in the screenshot). If prompted by UAC, click yes.

To clean the winsxs folder in Windows, make sure that the checkbox next to the “Cleaning Windows updates” sub-item is checked, since this section is responsible for deleting files in the winsxs folder. Check other items as you wish. In this window you can also estimate the approximate volume of released disk space. Finally, click OK and wait for the process to complete; you may need to restart your PC.

Note: the update cleaning function is built into Windows 8, 10. For Windows 7, Microsoft released an update to add this option. If you do not find the update cleanup item, then download and install the KB2852386 update package. The methods below do not work on Windows 7.

Cleaning with Task Scheduler

WITH Windows release 8 introduced a feature that allows you to clean the winsxs folder automatically. An automatic StartComponentCleanup task has been created in the OS, which runs in the background to delete old versions of files after 30 days. This period is given to prevent incompatibility of new updates. You can manually run this task by following the steps below.

To start the task scheduler, in the “Run” window (opened with the Win + R buttons), write the command taskschd.msc, then click OK.

On the left side of the window, expand the “Task Scheduler Library” section, then the “Microsoft” and “Windows” subsections, find the Servicing section and click it. Select StartComponentCleanup and click “run” on the right side of the window to start cleaning the winsxs folder. You need to wait about an hour.

Note: you can implement this task via the command line. You must then use the command:
schtasks.exe /Run /TN "\Microsoft\Windows\Servicing\StartComponentCleanup"

Cleaning via the command line

Dism.exe is a cmd application that allows you to perform various manipulations with Windows components, which will help clean up the winsxs folder. In Windows 10, 8.1 introduced new parameter AnalyzeComponentStore, which helps determine how much space the winsxs package actually takes up. Open a command prompt with administrator rights, enter the following command and press Enter:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

As a result of the calculations, you will know whether cleaning is recommended. To see the amount of memory that can be freed, pay attention to the items marked in the screenshot. The sum of these two elements shows the amount of occupied space on the hard drive.

After analysis, you can start cleaning the winsxs folder. The StartComponentCleanup parameter in cmd gives similar results as in the task scheduler. However, components are removed immediately, without waiting. In cmd with admin rights, enter the following structure, then click Enter:

Dism.exe /online /Cleanup-Image /StartComponentCleanup

Using the ResetBase parameter you delete all outdated versions each component. The command looks like this:

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

The SPSuperseded parameter helps reduce the space that the service pack takes up. Use this command:

Dism.exe /online /Cleanup-Image /SPSuperseded

Wait for these commands to complete. Next, estimate the amount of freed memory using the AnalyzeComponentStore parameter.

Removing Windows components

Windows 8, 10 allow you to enable or disable Windows OS components. These functions are located in the “programs” section.

All Windows components are stored in the winsxs folder, regardless of whether they are enabled or not, and take up space. There is a way to help remove these components from winsxs entirely, thereby freeing up space. In the future, you will be able to download removed components as needed.

Run cmd with admin privileges. Type the command below, then press Enter:

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

The command line will build a table of component names, as well as their states. Remember the name of the component to be removed and use the following command:

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

In this command you need to replace NAME with the name of your component. In the example we will remove DirectPlay.

This will change the status to Disabled with Payload Removed. These are the ways you can clean up the winsxs folder in Windows.

That's all, now you know winsxs - what it is Windows folder 7, 8, 10 and how to clean it. It is recommended to use the first three methods first, although you don’t have to resort to the task scheduler method, since it is duplicated, but everything is at your discretion. Removing components is not recommended because it will not free up much space and the removed components may be needed in the future. You can also do this to free up additional space on the HDD.



Related publications