Reclaim Some Of The Disk Space Which Windows Stole


If you've been trying to clean up your hard disk recently, and looking for ways to free up space, chances are you've been using a programs such as one of those listed at to help you.  For what it's worth, the program I prefer is WinDirStat, which you'll find listed on that page along with many others.

But once you've found which folders are taking up the most space, deciding whether or not they are safe to delete is your next problem.  Generally, unless you know that something within a Windows system folder is safe to remove, you should leave it alone.  Or Google for that particular file or folder, along with a phrase such as "can I delete", to find out what others have done in a similar situation.

When you're looking for space-hogging folders on your PC, one of the worst culprits is something called winsxs.  This stands for Windows Side-By-Side, and is a system folder designed to allow Windows to repair itself if something goes wrong.  It holds duplicate copies of most system files.  Trouble is, it can get very large indeed (5 GB is not unusual), and Microsoft advises that deleting this folder will probably break your computer.

Thankfully, though, there's a tool built into Windows 7 and 8.x which can help to free up space in winsxs.  It does this by deleting any system file which has been superseded.  For example, when you install a service pack, winsxs now holds both the old and new copies of updated files.  The tool deletes the old versions, and can save you a few GB of disk space.  

The program which does this magic is called Deployment Image Servicing And Management, or DISM for short.  And the particular command you need to use in order to free up some space in winsxs is:

dism /online /Cleanup-Image /spsuperseded /hidesp

Let's look at what this command does.  Firstly the /online switch means that you're running it against the current, live, Windows installation, rather than an image stored on disk as a virtual machine.  The cleanup-image switch signifies that you want to clean up winsxs.  The spsuperseded switch means that you want to delete service pack files which have been superseded.  And the hidesp tells Windows to hide the option in Control Panel which would allow you to uninstall the last service pack (which won't now work, since you've deleted the files which the uninstall would need to put back).

So, to use DISM, create a batch file (don't call it dism.bat or Windows will get confused) that looks like this:



Once the batch file is created, right-click it and choose Run As Administrator.  If there are any files to delete, the process will take around 15 minutes to complete so you'll need to be patient.  But you should end up with some additional disk space. In my case it was around 3 GB.

Note:  As always with tools such as this, it pays to ensure that your backups are up to date beforehand.  


Please rate this article: 

Your rating: None
Average: 4.2 (18 votes)


I don't mean to be rude and I understand that some people are working under severe restrictions. But for the most part, I think that if you are so tight on disk space that you are trying to squeeze out an extra few gigs of storage then you would be better off just upgrading your hard disk or adding another. Disk space is cheap and I doubt that this sort of cleanup is going to have any significant positive effect on the system. Maybe you just like to tweak your system - that's fine. Just my two cents...

A perfectly valid question. Let me give you one possible answer. At the place where I work, we run enterprise-level virtualized fault-tolerant servers. The hard disks are top-quality and very fast. Everything in the datacentre is mirrored, and also synced to another backup datacentre down the road. And the virtualization software steals 20% of everything for its own use. Which means that, although I can buy a terabyte of usable disk space for my home PC for around $100, our stuff at work is more like $5000. If I can save 3 GB of space on each of my 14 servers with 10 minutes of effort, that's a real saving. Add in the 400+ other servers that we have, and it becomes even more so.

Not quite so!! Many, including me, use SSD for C drive to keep windows fast enough and SSD are expensive still while Windows is greedy in DISK space on C drive...

There are many reasons why people might need the space and might not be because there is not enough space on the hard disk. I just had a temporary problem on one of my partitions (logical drives on one hard disk). There was only 2 of 100GB free even after cleaning up all the files. So I did what this article instructs to free up some space. This allowed me to complete the testing I was doing. After I finished I uninstalled all the programs I no longer needed and had about 25 GB free again. It was easier to delete the files than to repartition the hard disk, which would have affected five partitions just to expand that one logical drive.

My winsxs folder is 9.3 gigs and I'd be okay with that except the preinstalled Win 7 Pro (64bit) won't let me expand the partition. My drive C is partitioned into *:System, C:Windows, *:Recovery image and E:New Volume. I want to expand the meager C:Windows (59 GB) to include all of E:New Volume for a total partition space of 217 GB. But that little 15 GB partition called *:Recovery blocks me from doing it because the space I want to include in the expansion is not contiguous.

Any ideas?

I would backup your files on the current boot partition and then install a new boot partition & Win 7-64 in the larger 217 Gb partition, wipe the old one / turn it into a non-bootable partition.

Some partition tools may allow you to use non-contiguous media but probably not worth the time messing with it. I quite like the free MiniTool Partition Wizard.

Running Windows 7 Pro. winsxs is over 9g but utility above says nothing to delete. Would using SymMover to move winsxs to another disk break Windows?

Interested in the forum.

Good tip, rob... tks! :-)

I understand I can run this command as stated above:
dism /online /Cleanup-Image /spsuperseded /hidesp

But I want to just see what "dism" will do as far as space savings WITHOUT making any actual changes on my system. Or at the very least, see just how much "dism" will change if I actually tell it to run. Is this possible?

Find the winsxs file either by your local "Search Program and Files" via your Start menu or another search program, i.e., "Everything" and right-click, "Properties". You will then see the size count-up the space...

If you are using Windows 8.1, this command --
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
will do what you want.

See --

Nichols - thank you for the info! The trouble is, I'm using Windows 7 64-bit, not Windows 8.1... Is there a way to see what effect the running of "dism" would have on a Windows 7 system WITHOUT making any actual changes?

Yes. Run the Disk Cleanup program after installing the update as described here:

The "Windows Update Cleanup" line will show you how much ...\winsxs file space will be freed. You checkmark this line to remove the dupes.

Rob - Just a quick thank you for this article. My WIN 7 gave up the ghost on 1.17 GB... which I'll gladly take. Appreciate. :)

Is it not the case that the WinSXS folder uses hard links and that it thus may appear much, much larger than it actually is – since it's effectively counting numerous files more than once? recommends using
Dism.exe /Online /Cleanup-Image /AnalyzeComponentStore
but that only works for Windows 8.1 and not earlier versions.

I could be mistaken, but Microsoft has an add-on for its Disk Cleanup Wizard that more easily does the same cleanup for winsxs. See Again I could be mistaken, but I thought I first learned about this from the Gizmo newsletter.

This is a great find :-)

Ran the commands from one of the links on my 8.1 machine and it cleared 3Gb of space.

Followed Robs instructions for a Windows 7 machine and it worked a treat too.

I do hope that Microsoft do a little more thinking about this folder for the next iteration.

Big thumbs up for this article.

Aninnymous, for Windows 8.x the information at --
and at --
is complex.

Can Gizmo's offer simpler information for cleaning-up winsxs in Windows 8.x?


Perhaps the easiest way is to follow the Disk Cleanup executable instructions given at the Win 7 link below. You should not need to download anything for Win 8 but it may look a little different.

There are plenty of pictures at the link - just look for the "Windows Update Cleanup" choice and click that (and any others) if it shows a big amount will cleanup.

Apparently Win 8 may perform this cleanup automatically if it is setup properly but I am unclear about that--read thru really fast.

BTW, I was mistaken. The cleanup happens during the needed reboot process following running the Disk Cleanup, not after 30 days. So reboot to recover the space immediately.

On a fully updated Win8.1 system that has been used for 9 months, I ran --
Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase
which I understand from --
removes all superseded versions of every component in the component store.

DISM reduced used space on C: by 0.1 GB. So I conclude that Win8.1's automated winsxs clean-up is working well.

Indeed. It would seem so.

OK, discovered the issue with Win 7. The program capabilities were added in NEW .exe {a non-critical Windows update meaning I did not install it).

Here is the link for how to download & use it on Win 7 which is somewhat DIFFERENT from the Win 8 operations:

I used the Disk cleanup executable method and it worked as expected (4GB scheduled for removal in 30 days). They mention something similar for Win 8 below but I have not tried it.

And the MS link for Win 8:

The links in my previous post are for the OLD DISM version and do not include the new command line switches. Sorry !

I hope Aninnymous or another does have "have some time to fuss with it" because removing superseded winsxs files is a VERY good idea! I considered "fussing with it" but as soon as the "/?" switch showed me a long list of available switches I did not dare proceed. If rob schifreen is monitoring this thread, maybe he can help?

Same here for Win 7 SP1+ 64bit .... "Service Pack Cleanup cannot proceed: No Service Pack backup files were found. The operation completed successfully."

It would appear something is wrong with the process as described.

I will mess with it from info at:

and especially here (from link at above)

when I have some time to fuss with it, if ever. I have 12+ gig in there and really would like to cut that down some. Perhaps permissions level changes are required or some such.

In theory, some recent versions of Windows 7 and 8 *should* be running an automatic regular timer job which cleans up some of the worst excesses of the winsxs folder. The DISM command that I wrote about is a way of forcing that job to run. Which is why, in some cases, DISM won't free up any space. It probably just means that Windows has already taken care of it. Note that you SHOULD NOT delete any files from winsxs yourself. Apart from the ones that DISM may or may not delete, messing with anything else in that folder may result in a PC that doesn't work properly.

I got the same result that Mr. Fraser did -- also with a Windows 8.1 system that has been running and updating for months. The message was -- "Service Pack Cleanup cannot proceed: No Service Pack backup files were found. The operation completed successfully."

Fine. This simply means that Windows has been taking care of things, and there's nothing remaining which is safe to delete.

Same here Nichols on Win 8.1 x64 SP1. Guess nothing to find.
Used the Cmd Prompt Admin. dism /online /Cleanup-Image /spsuperseded /hidesp

To try this out, I simply pasted the text into a Command prompt window, "run as Administrator." The program worked, no question about that.
But the result I got was -- I forget the exact wording, but something like "Program ran successfully. There are no setup files, so nothing was done."
I've done this on both a Windows 8.1 system and Windows Server 2012 R2. Same result with both; and both have been running, and updating, for months.