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)


Is there any downside to this procedure?