When you purchase a new computer or reinstall your operating system, it often seems to have infinite amounts of disk space. As a user, you might wonder if you’ll ever need those 500 gigabytes or 1 terabyte of space. But things usually look different after you've used the computer for several months and installed various space-intensive applications. Your free disk space gradually shrinks in a seemingly inexplicable way. One reason for this is that the Windows operating system requires a significant amount of disk space to update and maintain system files.
Updates are often downloaded and installed in the background. If an update fails, you can usually restore the previous version of an application. This version is stored in a system folder called WinSxS. The folder has other important functions too. Over time, it takes up a considerable amount of disc space. This raises the question of when and under what circumstances you should clean up the WinSxS folder. Most importantly, however, you should never manually delete files from the WinSxS folder. This can significantly affect your system's ability to function.
The WinSxS folder in detail
WinSxS is a system folder in Windows. That’s why it’s located on the system partition. WinSxS stands for “Windows Side by Side,” which is a good description of the folder’s purpose: different versions of files are stored together, side by side. The folder is also called the component store. It primarily contains system files and can be several gigabytes in size.
Functions of the WinSxS folder
The WinSxS folder stores the necessary files for system recovery. Specifically, it allows for the following applications:
- Simultaneously saving different versions of Dynamic Link Libraries (DLLs) and other system files: Older applications may not be compatible with changes in DLLs. Therefore, different versions are stored in the WinSxS folder at the same time.
- Enabling and disabling functions while Windows is running: Some Windows features, such as the virtualisation solution Hyper-V and the corresponding sandbox system, can be enabled without having to be installed separately. The necessary files can also be found in this location.
- Adding roles in server operating systems: Functions in Windows server operating systems are also known as roles. For example, the server can play the role of a DHCP server on the network. The WinSxS folder is also used for these extensions.
- Restoring the system in the event of boot problems: If the operating system stops booting, it can be booted in recovery mode. This allows you to recover older versions of system programs.
- Uninstalling problematic updates: When Windows runs an update, it saves the previous version rather than deleting it so that it can be restored in case problems arise later.
Managing the WinSxS folder
Microsoft operating systems offer several options for cleaning up the WinSxS folder. You don’t need any third-party programs. There are hardly any differences between common Windows versions 8, 8.1, 10, and server versions. For all versions, the size of the system folders displayed in the Explorer does not necessarily match the actual disk space because of hard links to existing files.
Links are entries that refer to other files. A distinction is made between hard links and symbolic links (also called soft links). The contents of a file are stored separately from the metadata (name and path) in the file system. When you create hard links, a new name is entered that points to the location of an existing file. This entry is indistinguishable from the original file entry. By contrast, soft links contain only a reference to the original file entry. Soft links have the extension .lnk in Windows.
It's important not to delete unneeded program versions from the WinSxS folder until the system has been running stably for a long time. Otherwise, you may no longer be able to downgrade to an older version or remove updates.
Windows 8, 8.1, 10, Server 2012
You can use Disk Cleanup in Windows to clean up the WinSxS folder. You can also use this utility to clean up other Windows folders. You can open it from the search box or by typing cleanmgr.exe into the Windows command window. First, the system will ask you to select the drive you want to clean up. Next, you’ll be prompted to select the file types you want to delete. These include:
- Downloaded program files
- Temporary Internet files
- Delivery optimisation files
- Temporary files
You can also see the amount of disk space that you’ll be able to free up. After selecting the file categories, click the OK button to confirm that you want to delete the files. The cleanup will run automatically.
You can find further options under “Clean up system files.” However, you need administrator-level privileges to access these options. The program will then restart and ask you to select the drive you want to clean up. Next, a window appears with options for additional file types to delete:
- Windows Update Cleanup
- Windows Defender Antivirus
- Windows upgrade log files
- Device driver packages
The command-line tool dism.exe is a practical alternative to clean up the WinSxS folder. To use it, you have to run the Command Prompt program (cmd.exe) as an administrator. The command Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore analyses the WinSxS folder to determine how much disk space the folder is actually using. The output of the command provides useful information, such as the date of the last clean-up, and lists the components the disk space is being used for. The tool also allows you to clean up the WinSxS folder: Dism.exe /Online /Cleanup-Image /StartComponentCleanup
Further useful features of the program include:
- Dism.exe /Online /Cleanup-Image /ScanHealth for scanning the WinSxS folder
- Dism.exe /Online /Cleanup-Image /RestoreHealth for repairing any errors that were detected.
You can also use compression to reduce the size of the WinSxS folder, just as you would with any other folder. First, open the properties of the folder from the context menu and choose the “Advanced” option. Then, place a checkmark next to “Compress contents to save disk space.”
Using systems with Windows 7 is generally no longer recommended. As of January 14, 2020, security updates have been discontinued for this version of the Windows operating system. In the event that you're still using Windows 7 as a standalone system for a specific application, we’ll briefly explain how to manage the WinSxS folder in Windows 7.
Disk clean-up is also available in this version and is very similar in appearance to the utility in other versions of Windows. That means you can use the tool as described above. The dism.exe tool was introduced with Windows 7. However, it doesn’t have the same range of features. For example, it's missing the options for scanning the folder and repairing errors.
Alternatives for saving disk space
If reducing the size of the WinSxS folder isn’t enough, there are other ways to free up disk space:
- Disable system hibernation: Windows creates a snapshot of your system for hibernation mode. This file is called hiberfil.sys and often uses considerable amounts of disk space.
- Move user profiles to another drive: If you want to avoid reinstalling your system, you can change the location of your user profile sub-folders on the “Location” tab via Properties, which you open from the context menu of a folder. You can also move user profiles to a different drive such as a new hard drive.
- Move program folders: You can usually install space-intensive programs on other drives.
- Remove unneeded programs and functions using the “Apps & Features” option in the Control Panel
- Delete unnecessary folders such as Windows.old
- Disable restore points
Sometimes cleaning up Windows folders isn’t enough. In these cases, reinstalling or resetting your system is a better alternative. There are also reset options that don’t remove your installed programs or personal files. These options differ slightly in Windows 7, Windows 8 and Windows 10.
Why can’t you simply delete WinSxS?
Windows stores important system information in the WinSxS folder. If you delete or move the folder, certain processes may not be able to run properly. Why is that?
Disk drives in Windows
By default, Windows is installed on the first partition of the hard drive you’re using. These partitions are called disk drives or volumes. Together, they form a complete storage device. The first partition of a hard drive is usually given the drive letter “C.” The C:\Windows\ path contains most of the files and folders relevant to the operating system, including the WinSxS folder.
This content cannot be easily moved to other disk drives because components of the operating system will no longer find it. Therefore, it’s important to provide sufficient disk space for the system partition during installation.
The disk space of a hard drive must be managed in structures that are compatible with the operating system. One or more partitions are created for this purpose. Disk space is partitioned logically. Each partition is formatted with a file system that manages the folder structures and files, including their metadata. The hard drive maintains a partition table that lists all partitions.
Updates, service packs, and hotfixes
Operating systems and other applications have long ceased to be rigid entities that are installed once and then used for years. Due to their complexity and ever-changing requirements, operating systems require continuous improvements or extensions. You have different options for implementing these improvements: Hotfixes (quick fixes for a specific error), updates (a scheduled update), and service packs (a collection of updates and hotfixes) access the information in WinSxS to determine the health of your system. If the folder is missing the required references, the operating system updates will either not be installed at all or will be installed incorrectly.
Updates and upgrades have different functions. An update improves the software and is usually limited to existing features. An upgrade replaces the software with a higher-quality version or a new version when it becomes available. Downgrading involves reverting software back to an older or less complex version and is performed when newer versions have bugs.
The modular design of software is the reason for the dependencies between software and libraries or system functions. Some functions, such as opening files or querying the system time, are required by multiple programs. The operating system makes these functions available through programming interfaces so that developers can import them into their software. Many function libraries are located in the WinSxS folder. If you carelessly delete these files, various programs may no longer be able to run.
Lack of available hard drive space is still a frequent problem these days, especially if you have a laptop or computer with an operating system installed on an SSD. By cleaning up the WinSxS folder, you can get rid of unneeded files. However, it’s important that you do not manually delete any content from the WinSxS folder. You should always use Windows tools to delete these files. If major updates have been installed recently, you should avoid deleting these files altogether. Otherwise, you won’t be able to remove updates that may contain bugs.