Reduce Windows 7 WinSxS Folder Size
Posted By Chris Stinson in Windows on June 23, 2011
With Windows Vista, the WinSxS folder was able to be cleaned up via a third party tool (WinSxS Lite here – Vista only!). With the initial release of Windows 7, we lost that capability – but it has since returned with Service Pack 1.
The WinSxS folder is used to store install and uninstall files, windows packages (current and previous versions of a component) and out-of-band releases. You should not completely delete this folder. Post Windows 7 SP1, there is now a way to remove the unnecessary files from this folder using the command line (elevated/admin mode -> Click Start -> Type “cmd” in Search. Right click on “cmd” and choose “Run as Administrator”). This is great for reducing the Windows folder size for SSDs and netbooks. In my case it saved 3.5GB of space.

Before:

After:

Related posts:
- Disabling Windows Search in Vista: Stop hard drive running constantly
- Print Directory Listing in Windows
- Speed up low memory system running Windows Vista
- Disable User Account Control (UAC) in Windows 7
- Slimming down Windows XP Pro SP2 Install


(average: 4.83 out of 5)
46 Comments
I run an SSD on my laptop and my winsxs folder went from 10.5GB to 6.25GB! Thanks!
Just one pointer. Your article assumes that you are running a 32-bit Windows version. If you run the dism command on a 64-bit instance you get this error:
Error: 11
You cannot service a running 64-bit operating system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to your computer’s architecture.
The trick is to go to the sysnative directory (usually c:\windows\sysnative) and run the command from there.
Thanks again for the tip.
For 64 bit systems, I can confirm that the launch of dism from \Windows\System is required to effectively save the 4GB. Otherwise (from Windows\System32) there’s no error but you almost save nothing….
I’m running 64-bit version (Win7 Professional) and I ran it from c:\users\xxx and it worked just fine.
Thanks Chris!
Worked like a charm and freed up 3.3 GB on my SSD.
Seems to me that *everything* you run on a Win7 PC will increase the size of the WinSxS folder. Even a portable software that you run once and then remove. Since I found out, am using a VM to try new software…
Markus
Just ran ‘dism /online /cleanup-image /spsuperseded’ on Windows 7 Enterprise 64bit. Reduced ‘winsxs’ folder from 10.64gig down to 6.56gig
Rebooted and all is fine.
this worked like a champ i lost almost 10gb off the folder. thank you !!!
Worked great, went from 11.2 GB to 6.5 GB on my 64 bit Win7 (120 GB SSD)
following error is coming windows 7 ultimate 64 bit
Error: 87
The cleanuo-image option is unknown.
For more information, refer to the help by running DISM.exe /?
Please help….
You have a spelling error in your syntax: “The cleanuo-image option is unknown.”
You had typed: “cleanuo” instead of “cleanup”
c:\Windows\System32>dism /online /cleanup-image /spsuperseded
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Service Pack Cleanup can’t proceed: No service pack backup files were found.
The operation completed successfully.
This is with the sxs folder at 6.32GB
Version: 6.1.7600.xxxxx is the RTM build of Windows 7. This trick works with Windows 7 SP1 which should be version: 6.1.7601.xxxxx.
In the Disk Cleanup tool under administrative tools there’s an option to clean up Service Pack Backup Files, which seems to do exactly the same thing as this.
Yes, both work effectively. Using the command line is useful when you want to push this to a number of machines connected on a domain.
Thanks a lot, it works fine – got rid of more than 2GB. Great help!
Thank you, great way to spare the SDD space
I keep getting
Error: 11
You cannot service a running 64-bit system with a 32-bit version of DISM.
Please use the version of DISM that corresponds to you computer’s architecture.
The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
I’ve tried running cmd.exe from SysWOW64 but i couldn’t find sysnative.
I also tried changing the directory in cmd.exe to sysnative.
This gave error: 87
The spsuperseded option is not recognised in this context.
For more information, refer to the help.
The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
Not sure what i’m doing wrong. My hardrive is partitioned with windows installed on a 30gb section and the winsxs file is ~12gb so the partition is nearly full. Any help would be really appreciated.. ;(
Thanks
Dan: run it from C:\windows\system32. C:\windows\syswow64 has native 32-bit items in it, whereas C:\windows\system32 has native 64-bit items in it (confusing, huh?)
I got the same error, Dan – I had to install SP1 in order for it to run.
i have the same problem.
i guest this error is from the install kitt.
i install disk windows 7SP1
and this trick does`nt work!
Thanks to the post i have sames from 11gb to 6 gb
Thank you a lot, reclaimed 5 very valuable Gigabytes on my SSD, thank you again!
ran it from \windows\system32 on Win 7 professional 64bit and saved around 6.4 GB of disk space
can i just manual go into the winsxc folder and delete stuff? the command above keeps giving me:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows>dism /online /cleanup-image /spsuperseded
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Error: 87
The spsuperseded option is not recognized in this context.
For more information, refer to the help.
The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
C:\Windows>
Version: 6.1.7600.xxxxx is the RTM build of Windows 7. This trick works with Windows 7 SP1 which should be version: 6.1.7601.xxxxx
This doesn’t really help. I received the same error message and I am running Windows 7 Ultimate SP1 Retail. The ver command returns 7601 but the dism tool version is 7600.
Minus 3.4-3.5 GB.
Thanks a million!
Just ran on my Win7 machine. Awesome, Thanks : )
Now what about using on Server 2008 R2?
Safe?
Untested?
2008 R2 SP1 will work, but I don’t think Microsoft will like it, or support it.
I would recommend against it if you haven’t thoroughly tested your configuration or you aren’t sure that you won’t have compatibility issues with SP1 in the future.
I right clicked the CMD and run as administrator but it doesn’t do anything. Do I have ti type in a comand or something. I really need the help!!!!
Laura,
Yes, you need to type in the following and then press ENTER:
dism /online /cleanup-image /spsuperseded
Thanks a lot, it works fine reduced from 6.95 to 4.37
I just tried to run this in both the system and system32 folders and got the following error message in both cases:
“Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Removing backup files created during service pack installation.
Error: 0x8004231f
DISM failed. No operation was performed.
For more information, review the log file.
The DISM log file can be found at C:\Windows\Logs\DISM\dism.log”
Although the version shows as 6.1.7600 and not 6.1.7601 the OS is Windows 7 Pro SP1.
Any ideas why DISM failed and what I can do to make it run?
I’ve got the same error. You do not have enough disk space for creating Restore Point while performing this operation(see log file for details)
I’ve got Image Version: 6.1.7600.16385.
I had about 200 Mb free on C:\, freed up to 700 Mb, and while processing, my free space reduced to 300 Mb.
Total freed space – 3Gb.
This was awesome I went from 25 GB to nearly 9 GB of free space! Highly recommended A++
Haven’t read all the comments so it may already have been said but be aware that after you do this you cannot uninstall the SP…
Thanks.. Went from 11.1 GB to 6.77 GB on my Win7 64bit with (120 GB SSD)
All computers I have tried this on (OK, only two, but both running Windows 7 Professional, SP1), report:
————————————
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>dism /online /cleanup-image /spsuperseded
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Service Pack Cleanup can’t proceed: No service pack backup files were found.
The operation completed successfully.
——————————–
Notice that the shell reports 6.1.7601, while the dism command reports version 6.1.7600.16385.
I tried the command I received:
Error: 112
An error occurred accessing the temporary folder C:\Users\owner\AppData\Local\Te
mp\92A7CEF5-CA21-4E0B-98EF-FB18F36EFD80.
Ensure that the path to the temporary folder exists and that you have Read/Write
permissions on the folder.
The DISM log file can be found at C:\windows\Logs\DISM\dism.log
My c drive currently has about 480kb free out of a 58.5 GB drive. There were no problems until about a month ago and the problem was just “all of a sudden” there was no room.
Are you running the command from within a temporary folder? Or can you see C:\Windows\System32 at the left of the command prompt?
You can also go to:
Start -> All Programs -> Accessories -> System Tools -> Disk Cleanup
And try removing some other temporary files including browsing history and downloaded files.
Ok i’ve this error
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows>dism /online /cleanup-image /spsuperseded
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Error: 87
The spsuperseded option is not recognized in this context.
For more information, refer to the help.
The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
Is there a way to use this on a RTM too? Please my GB are more than 10 and i’ve only 1 Gb free on my 28 GB SSD…
Yep. I’ve got the same problem as Alex. I don’t believe that I’ve installed SP1. Does this command only clean out a service pack, or can it scrub away the bloated junk out of my swollen winsxs folder anyways?
I made the same mistake:
when you have typed in cmd, a new window opens. Right click on the top line where it says cmd, then select run as administrator.
It works fine after that. Went for 10.6G to 7G.
CCleaner takes care of this as well.
Hi everyone with errors,
What you need to do is first change your UAC settings the default settings (move the slider up to the 2nd from the top). Then, reboot! Then, right click on ‘cmd’ to run as administrator even if your current user has admin rights. Then, follow instructions from above. Hope that solves things.
Tried on Win 7 HP 64 bit. Get following error – doesn’t work !
C:\Windows\system>dism /online /cleanup-image /spsuperseded
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Service Pack Cleanup can’t proceed: No service pack backup files were found.
The operation completed successfully.
C:\Windows\system>cd \Windows\System32
C:\Windows\System32>dism /online /cleanup-image /spsuperseded
Deployment Image Servicing and Management tool
Version: 6.1.7600.16385
Image Version: 6.1.7600.16385
Service Pack Cleanup can’t proceed: No service pack backup files were found.
The operation completed successfully.