id="info"

Software

How to use the DISM tool to reveal the true size of Windows 10's WinSxS folder

A special option in the Deployment Image Servicing and Management tool will give you the real scoop on how much space WinSxS is occupying.

hero
Image: iStockphoto.com/Nonwarit

In my last couple of articles, I've shown you how to clean up Windows 10's WinSxS folder using Disk Cleanup and Task Scheduler. As I explained, you can access the WinSxS folder Properties dialog box to determine how much space is currently occupied by the WinSxS folder on your hard disk:

While that may seem to be a perfectly acceptable way to go about the task, it turns out that it doesn't tell you the true size of Windows 10's WinSxS folder. Recently I discovered that the Deployment Image Servicing and Management (DISM) tool provides a special option called AnalyzeComponentStore that shows you exactly what's what when it comes to the size of the WinSxS folder. The result will surprise you! Let's take a closer look.

The DISM tool

DISM is a command-line tool that lets you service and prepare Windows images, including those used for Windows PE, Windows Recovery Environment (Windows RE), and Windows Setup. As a part of the servicing features it provides, you can reduce the size of the WinSxS folder prior to distributing the images in a production environment. Doing so not only reduces the size of the images, but it increases the speed with which they can be deployed. As such, DISM can serve as another tool you can use to clean up the WinSxS folder on your Windows 10 system.

Even better, the DISM tool provides an analysis option that will reveal to true size of the WinSxS folder.

Using the analysis option

To begin, launch an Administrative Command Prompt window by right-clicking on the Start button to display the Quick Link menu and selecting Command Prompt (Admin), as shown in Figure A.

Figure A

Figure A

The Quick Link menu in Windows 10 gives you access to a host of commands, including an Administrative Command Prompt window.

Once the Command Prompt is accessible, enter the following command and press [Enter]:

Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore

The /Online option specifies that you are servicing a running computer. The /Cleanup-Image option specifies that you want to perform a cleanup operation. And the /AnalyzeComponentStore option specifies that you want to create a report of the component store.

Once you initiate the operation, DISM will go to work analyzing the contents of the WinSxS folder. It measures progress ASCII style, with set of equal symbols and a percentage measurement. When the analysis is complete, you'll see a report like the one shown in Figure B.

Figure B

Figure B

The DISM report is displayed in the Command Prompt window.

According to Microsoft documentation, the sections of the DISM report are defined as shown in Table A. You'll want to pay attention to the information in the Key Detail column.

Table A

Table A

DISM Report sections.

Finding the real value

You'll want to focus the descriptions of the Actual Size of Component Store and the Shared with Windows sections of the onscreen report. This essentially tells you that even though some files are being included in the total size of the WinSxS folder, they actually exist in other parts of your hard disk—so they aren't really in the WinSxS folder itself. This fact is specified by the use of the term hard link, which is a special NTFS file link that is defined as follows:

A hard link is the file system representation of a file by which more than one path references a single file in the same volume.

This means that most of the files being counted in the total are actually represented by hard links.To calculate the REAL size of the WinSxS folder, subtract the Shared with Windows value from the Actual Size of Component Store value. In the case of my example system, that would be:

6.29 GB - 5.37 GB = 0.92 GB

This reveals that the actual size of the WinSxS folder on my hard disk is actually less than 1 GB. If you add up the values of the Backups and Disabled Features and the Cache and Temporary Data, that comes out to:

752.29 MB + 169.31 MB = 921.6 MB or 0.92 GB

So the actual size of the WinSxS folder is much smaller than it appears in folder Properties dialog box. What a relief, huh?

Of course, 6.29 GB of extra files are still hanging out on my hard disk somewhere, but now I know that the WinSxS folder is not the disk space hog—full of duplicates—that I once thought that it was.

Using the cleanup option

If you want to use the DSIM command to perform the cleanup operation, you'll use a similar command line as shown earlier, except that instead of the /AnalyzeComponentStore option, you'll use the /StartComponentCleanup option. As you can see, this option has the same name as the task that you use in Task Scheduler. However there are two differences.

First, previous versions of updated components will be deleted immediately rather than having to wait for the 30-day grace period. Second, the one-hour timeout limitation is removed. Instead of abandoning the cleanup operation if it takes longer than an hour, the DISM option will run to completion.

To begin, launch an Administrative Command Prompt window as described earlier. Once the Command Prompt is accessible, enter the following command and press [Enter]:

Dism.exe /Online /Cleanup-Image /StartComponentCleanup

In this command line, the first two options are the same, and the /StartComponentCleanup initiates the cleanup operation. As soon as you initiate the operation, DISM will go to work cleaning up the contents of the WinSxS folder. When the operation is complete, you'll see the message shown in Figure C. While this screen doesn't indicate how much space (if any) was reclaimed, you can run the command with the /AnalyzeComponentStore option again and compare the total values.

Figure C

Figure C

When the operation is complete, your screen will look similar to this one.

Using the full cleanup option

If you are completely satisfied that all the installed updates are working correctly, you can use the /ResetBase option and recover a lot more disk space. However, keep in mind that if you run the DISM command with this option, you will be unable to uninstall any updates, patches, or service packs. In other words, there's no turning back.

To begin, launch an Administrative Command Prompt window as described earlier. Once the Command Prompt is accessible, enter the following command and press [Enter]:

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

In this command line, the first three options are the same, and the /ResetBase option removes all superseded versions of every component in the component store.

Also read...

What's your take?

Were you worried that the WinSxS folder was disk space hog, full of duplicates files? Fortunately, using the DISM command's /AnalyzeComponentStore option reveals the truth. What did you find was the true size of the WinSxS folder on your hard disk? If you have comments or information to share about this topic, please share it in the discussion below.

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

Editor's Picks