Winsxs is huge… Free up a few Gigabytes with dism

I was running out of disk space in C: and was unable to install a small software that I needed, so I decided to clean up a bit. For that I like using WinDirStat which very quickly allows you to find where the big files/folders are. In this case I found that my c:\Windows\winsxs folder was over 12 GB of size. One way to reclaim some of that disk space is to cleanup all files that have been backed up when a Service Pack has been installed. To do that in Windows 7 you can run the following DISM command:

dism /online /cleanup-image /spsuperseded /hidesp

That freed up 4 GB in my machine and now I can move on.

Disclaimer: I only ran this in my Windows 7 machine and it worked great, have not tried it in Server SKUs so run at your own risk.

Comments (9)

  1. ATUL KHACHANE says:

    Is it full proof solution….as I believe that there are several people on the internet says that it might ruin the entire server if anything goes wrong there in the clean up process

  2. Csaba says:…/2592038

    The component store will show a large directory size due to the way the Windows Explorer shell accounts for hard links.  The Windows shell will count each reference to a hard link as a single instance of the file for each directory the file resides in. For example, if a file named advapi32.dll was 700 KB in size and was contained in the component store and the Windowssystem32 directory, Windows Explorer would inaccurately report that it consumes 1400 KB of hard disk space.

  3. Guy says:

    I had over 11GB in the winsxs folder and after running that command I now show 7.4GB! Thanks for the info!

  4. blowme says:

    its not inaccurately saying 1400 .(2 files at 700kb each is 1400kb ')

    these are two different files  ///not short cuts to the same file

  5. chris says:

    Csaba is right…the kb article is just explaining that this particular folder is not displaying its true size correctly because of the way explorer handles hard links…so, for just this folder, it is inaccurately showing its size because its adding to it the size of the files in other folders within the OS…so blowme your wrong…and you can just blow me.

  6. Asher says:

    More information on the command can be found here under the resolution section:…/2592038

  7. Pissed off says:

    Now the link is gone? Very clever and well played MS!

  8. Pissed off says:

    This command line (CMD) string worked well.

    dism /online /cleanup-image /spsuperseded /hidesp

    Removed 4.56GB for me.

Skip to main content