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.
Advertisement



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
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!
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!
Mikey said
My thanks also. Totally agree with Jamie. Down from 9.4 to 6.0 gig.
) )
(Nice post date Jamie.
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!!
Gary said
Make sure you cd to the Windows\system32 folder first.
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!