Cleanup Winsxs after Windows 7 SP1 install
Posted by Alan McBurney on March 16, 2011
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.



Jamie said
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!
Seb said
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.
Paul said
Wow… thank you very much for this!
twpod said
Thanks !! 4,3 Gb
Jimmy Gibbs Jr. said
Thanks a lot!
Mike Thompson said
Only recovered about 1.5 GB from my XenDesktop image. But this is EXACTLY what I have been looking for. Excellent!
Mike P. said
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!
Mikey said
My thanks also. Totally agree with Jamie. Down from 9.4 to 6.0 gig.
(Nice post date Jamie. :o) )
Steve said
Very effective. Worked well.
Thanks!
Parag said
Any similar command for vista?
Alan McBurney said
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 π
Alan
Michoko said
Thanks a lot! Reduced the winsxs folder by 4 GB too! π
Salin said
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.
Alan McBurney said
Was your OS installed using media that already had SP1 or was the SP installed onto the RTM Windows 7?
Boushi said
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.
Jase said
error 87 is apparently a spelling error, check you have typed command correct, spelling/spaces etc, worked for me π
SquallV said
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!!
The free radical said
dism /online /cleanup-image /spsuperseded
this is the exaxt syntax…..U need to add spaces between the words and the slashes….
Willianne Petersen said
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…
sharjeel said
i have also the same problem.plz some body help
Myk said
My ‘spelling mistake’ was to spell last switch using a a ‘c’, make sure you have spelt it with an ‘s’;
/spsuperseded
Gary said
Make sure you cd to the Windows\system32 folder first.
Nate said
Had the exact same issue, went away after I installed SP1.
thunder said
Don’s miss the space after each command.
Peter said
Hello,
i had the same trouble….error 87, put SP 1 and updates in…….all good
Fabio said
Very useful.
I save about 4 GB of space !
Thanks
Ismael Glez. said
Thanks!
I did it and it saved 1.81 Gb.
π Cool site!
bear187k@gmail.com said
Thanks for the info – I was able to reclaim upwards of 20GB from that greedy folder!
subbu said
nice one, thanks Alan.
chris said
took back 9 GB but my used space stays the same for the drive?
chris said
only cleared up about 3 gb of space
Roee said
Wow!!!….
winsxs went from 10.2G to 6.45 G…
10x a lot from Israel…..
Jeff said
Went from 10.5GB to 6.5GB. Thanks!
Nir Levy said
Thanks for the tip. Gained 2Gb.
kizzx2 said
Great, worked like a charm. Thanks!
Changis said
You might have to wait a few minutes after it reaches 100% atleast in my experience
Frank said
Yeah, even takes a good while for the progressbar to appear…
Reduced my winsxs folder from 11gig to 6,6gig =) Thank you very much
ejsik said
Gained 4,4GB.
Thanks!
outseeker said
4GB recovered! TY!! π
paul said
Same error as Salin. Could you please advice?
Jase said
Same…help please! π
Jase said
sorted!
error 87 is apparently a spelling error, check you have typed command correct, spelling/spaces etc, worked for me π
Dave W said
Hi,
The same action can also be performed using the disk cleanup tool included with Vista/Win7
Regards,
Dave
Alan McBurney said
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
Gaurav Goyal said
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.
Alan McBurney said
See above post comments.
Thanks
Alan
Adrien Marie said
worked as a charm, saved 3.5GB
Thanks a lot
Cleanup Winsxs after Windows 7 SP1 install | Jesus Was Rasta said
[…] Cleanup Winsxs after Windows 7 SP1 install Β« Alans sysadmin Blog. Share and […]
Nathan said
Knocked 3GB of crap off. 9GB -> 6 GB.
leni said
ΠΠΎΠ»ΡΡΠΎΠ΅ Π‘ΠΠΠ‘ΠΠΠ !!!
ΠΠ°ΠΏΠΊΠ° winsxs ΡΠΌΠ΅Π½ΡΡΠΈΠ»Π°ΡΡ Π½Π° 2,5 ΠΠ±
Π£ΡΠ° !!!!!!!!
canadiantrip said
You’re a life saver. Your post actually works than the one posted in microsoft’s website. π
Thanks a lot!
Strangelove said
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?
Alan McBurney said
There is no way to cleanup the WinSXS folder on a non SP1 Windows 7 machine.
You will need to try and free space on the drive.
Please see http://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/how-do-i-reduce-the-size-of-the-winsxs-folder-in/5a289b22-b774-e011-8dfc-68b599b31bf5 for some ideas on how you can free up additional space.
OsamaSd Hussein said
Thanks a lot work very fine with me, thanks again.
Irfan Sarwar said
is there any command to free up remaining 6 gb
BBO72 said
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.
lokiki said
you saved me almost 6Gb on my 11.7Gb folder, great trick !
Cheers from France and merry christmas
darkpenguin350 said
From 10.5 Gb to 6.5 Gb
Thnx man…
David Rudduck said
Thanks for the helpful tip.
Almost need to automate this process for customers because it is an ongoing concern!
xpanmanx said
Zoinks! 10.8GB to 1.9GB. Thank you! π
Andy said
Cut the folder size in half! You’re my hero!
ktell said
sweet doggies. Now on to the “Installer” folder.
Thanks dude!
Kaloyan Nikolov said
God, mine is 7gb and when i do this it says there’s nothing to clean.
Knight said
From 6.78 Gb to 4.60 Gb
Thank you
touranaga said
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>
umair shaikh said
in my case it says “the spsuperseded option is not recognized in this context
“
6 ways to reduce disk usage on Window 7 | jonaslinde.se said
[…] winsxs I found some good tips (here and here) on reducing the size of the winsxs […]
Strange issue consumes disk space on Windows 2008R2 sp1 said
[…] Here is the link on how to clean up that leftover backup files and get back 4gb or more: (https://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install/) […]
how to be a blogger said
how to be a blogger…
[…]Cleanup Winsxs after Windows 7 SP1 install « Alan's sysadmin Blog[…]…
Jacob said
Thank you very much; Winsxs folder went from ~10GB to 6.53 GB.
Honusnap said
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 …. π
David W. said
Thanks!!! 15.5 to 7.7!
BTW…”Elevated Prompt” = “Run as Administrator”.
Ameen Harun said
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 !
John E said
Thanks heaps. My winsxs was using 13GB but I have it down to 7.7GB after running the DISM command you suggested.
Amit Kamrani said
Thank you so much. Much appreciated…:)
Phil said
Thanks a lot you’re a life saver =)
Clean up Winsxs on Windows 7/2008 R2 after SP1 install – Cybernet Developers said
[…] @Alan’s sysadmin Blog Posted in News, Tools – Tagged HowTo, Tips, Winforms SHARE THIS Twitter Facebook Delicious StumbleUpon E-mail « [HowTo] Write Excel file to web page (aspx) No Comments Yet […]
MeChicago said
Thanks for the tip, this worked great. It freed more than 3gb from my SSD http://imgur.com/a/fo9Zz 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 π¦
SvenNilsson said
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.
fernando said
why i found error : 740
please help me
Xee said
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.
felipe said
Muy buen aporte me funciono graxias….
DrStrangepork said
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?
Matt said
This worked great. Cut my winsxs folder forom 11 GB to 6.7GB. Thanks so much.
How I cleaned up Windows 7 « skynss said
[…] https://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install/Β cleanup c:windowswinxsx ( winsxs folder ) as it was too big. Used this command (run as […]
Mr.Hostile said
Works fine i got 14GB now is 10GB but i wait for 3 hours to get exactly the same screanshoot of command prompt
Nick said
Fantastic advice. Saved over 6 GB from a very crowded 14GB winsxs file. Thanks!
Nikita said
Only copy it and add to cmd
DISM.exe /Online /Cleanup-Image /spsuperseded
Kevin M said
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!
pablo said
From 16,8G to 9,33G! Thank you!
How To Shrink The Main Windows Folder? | Click & Find Answer ! said
[…] Source:https://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install […]
Command to clean up a HDD if you find the WinSXS folder to be the culprit | Sysadmin Manhattan said
[…] https://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install/ […]
harddisk cleanup – winsxs system folder. | machinecoder said
[…] https://everythingsysadmin.wordpress.com/2011/03/16/cleanup-winsxs-after-windows-7-sp1-install/ […]
Phil said
Worked really well, exactly what I was looking for, thanks