Cleanup Winsxs after Windows 7 SP1 install

I recently noticed that the free space on the 60GB OS partiton on my laptop was running very low on space. Some of this was due to old offline files which I managed to cleanup fine.
I then ran Tree Size on the OS partition and found that the winsxs folder was 10.2GB.

After a bit of research I managed to use the command below and reduced the winsxs by 4GB :)

DISM /online /Cleanup-Image /SpSuperseded

The command needs to be run from an elevated command prompt and you cannot uninstall the Service Pack after it completes

I then did the same on my desktop and recoverd an almost identical ammount.

Pre CleanUp

Post Cleanup

94 thoughts on “Cleanup Winsxs after Windows 7 SP1 install

  1. Worked a charm, actually dropped my winsxs folder down to 5.8GB from about 10GB,

    Many thanks Alan for your hardworking research and taking the time to post your solution!

  2. Great tip! No idea why they wouldn’t give you the option right after the installation. I got about 4 GB out of this which on my poor little SSD is pretty good going.

    Maybe you could put the command in string down so people can copy paste:

    DISM /online /Cleanup-Image /SpSuperseded

    Yes, I am that lazy.

  3. Only recovered about 1.5 GB from my XenDesktop image. But this is EXACTLY what I have been looking for. Excellent!

  4. Thanks for posting this. Win7x64 with SP1 recently installed. This shrank the winsxs folder from 10.5 to 6.5GB. That’s a nice chunk of valuable space on my SSD!

    • Sure although it depends on which SP you are running as the commands vary.
      For SP1 use vsp1cln.exe and for SP2 its compcln.exe, both tools are located in %windir%\system32

      Good to see MS making things easy and transparent :)


  5. While I tried to do it i shows the
    Error 87
    The spsuperseded option is not recognized in the context.
    For more information, refer to help.
    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

    Please help me.

    • Was your OS installed using media that already had SP1 or was the SP installed onto the RTM Windows 7?

      • I am having the exact same issue. My Harddrive was wiped clean and had Win7 installed on it. Currently my winsxs folder is taking up 15.5 gigs on my 20 gig harddrive that is specific for Windows and I install programs onto a different harddrive.

      • I also have the same problem and double checked the command over 6 times and its stil giving the same error x.x. someone help please!!

      • dism /online /cleanup-image /spsuperseded

        this is the exaxt syntax…..U need to add spaces between the words and the slashes….

      • I got my laptop with Windows 7 and SP1 already installed, and I get the error 87 as well… I’ve checked the spelling, and I paste the command at c:\windows\system32\> yet it still doesn’t work… what can I do? My winsxs is 11GB…

      • My ‘spelling mistake’ was to spell last switch using a a ‘c’, make sure you have spelt it with an ‘s’;

    • Yeah, even takes a good while for the progressbar to appear…
      Reduced my winsxs folder from 11gig to 6,6gig =) Thank you very much

    • Its true that the Disk Cleanup Utility can be used to clean up system files on Windows 7 although the same isn’t true for Windows 2008 R2 unless you install the Desktop Experience feature which doesn’t sit well with many server admins.

      The article (although not explicitly defined) was aimed at both Windows 7 and Windows 2008 R2

      So if you need to cleanup the SP on Windows 2008 R2 without installing the additional features the only way is via the above command.

      I also much prefer the command as it gives you some idea of the cleanup progress

  6. Windows System Cleanup does the same job.

    Right click on a drive, select Properties and follow the options -> Disk Cleanup -> Cleanup System files -> Select Service Pack backup from the list.

  7. Pingback: Cleanup Winsxs after Windows 7 SP1 install | Jesus Was Rasta

  8. This doesn’t work on Win7 without SP1 (see Salin’s message for details). On my system, this folder is already so huge I simply don’t have any more free space on C:, less than the minimum necessary to install SP1. Any ideas how to do it without SP1?

  9. I get following :

    C:\Windows\System32>dism /online /cleanup-image /spsuperseded

    Deployment Image Servicing and Management tool
    Version: 6.1.7600.16385

    Image Version: 6.1.7601.17514

    Service Pack Cleanup can’t proceed: No service pack backup files were found.
    The operation completed successfully.

  10. Running 64bit Win7 Professional and I ran the option form the C:\Windows\system32>
    worked like a charm!! cleared about 3GB
    Thank you very much you just save my fragile Acer Aspire S3 with the mighty 20GB of SSD…
    millions of gratitude
    Running 64bit Win7 Professional and I ran the option form the C:\Windows\system32>

  11. Pingback: 6 ways to reduce disk usage on Window 7 |

  12. Pingback: Strange issue consumes disk space on Windows 2008R2 sp1

  13. Pingback: how to be a blogger

  14. Well really strange …
    Run the command before installing SP1 => No effect, Winsxs remains at 5.45Gb.
    Installed SP1, Winsxs becomes 6.7Gb
    Run the command, Winsxs becomes 4.5Gb .. !

    => Should i install SP1 and run the command again …. :-)

  15. Thank you so much ! I used SSD for my main c: drive to speed things up. With SSD the space is on the premium side and reducing winsxs helped a lot !

  16. Pingback: Clean up Winsxs on Windows 7/2008 R2 after SP1 install – Cybernet Developers

  17. Thanks for the tip, this worked great. It freed more than 3gb from my SSD just wish there was a way to clear the rest out. All the subs in the winsxs folder have a amd prefix, and im not running an amd :(

  18. Awesome, my 20GB disk was so damn full after installing Win Server 2008 R2, that I thought about giving up. Now I have 3GB free.

    • You need to run it from an elevated command prompt. Follow the instructions below:

      1. Open the Start Menu.

      2. Click on All Programs and Accessories, then right click on Command Prompt and click on Run as administrator.

  19. What I’d like to know is why the winsxs directory is STILL >6G after you cleaned it up! I have absolutely no intention of ever uninstalling any Update or Service Pack, so how can I get this directory as close to 0 as possible?

  20. Pingback: How I cleaned up Windows 7 « skynss

  21. Thank you so much! I’m careful about my C: usage, but had no choice but to install premium versions of some development tools that I knew would eat C: up. I hate to see red in the drive usage bars, and prefer to have 15% unused so defrag can do it’s thing. This did the trick beautifully, and I wish Microsoft would just make something like this part of its updates! Thanks again!

  22. Pingback: How To Shrink The Main Windows Folder? | Click & Find Answer !

  23. Pingback: Command to clean up a HDD if you find the WinSXS folder to be the culprit | Sysadmin Manhattan

  24. Pingback: harddisk cleanup – winsxs system folder. | machinecoder

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s