What can I safely delete from the "C:\WINDOWS" folder?

15

3

I have a Windows 7 system, and my C: drive is regularly getting full.

What can I safely delete from the C: drive, especially the Windows system folder?

Ula Krukar

Posted 2011-10-15T09:50:47.417

Reputation: 261

Answers

16

The biggest stuff in C:\Windows should be the winsxs folder, read more about that problem Why does the /winsxs folder grow so large, and can it be made smaller?. Since that stuff is used by all kind of apps, you must not remove it. And since it is the biggest chunk (of "junk"), all other directories do not matter that much any more.

You can obviously remove some leftovers / rollback-stuff, best done via http://www.piriform.com/CCLEANER.

To make it short: Buy a bigger disk.

akira

Posted 2011-10-15T09:50:47.417

Reputation: 52 754

The winsxs folder is actually much smaller than it appears. Lots and lots of aliased files. – Jamie Hanrahan – 2015-09-07T09:34:07.190

2"aliases" as in "hardlinks", but true. – akira – 2015-09-07T11:04:42.323

Some machines, like tablet PC's, are sealed with a relatively small SSD. [My Chuwi Hi10 has a 64GB drive]. Every byte you can claw back is a victory. I started with the language directories in System32 subfolder. – Alan Campbell – 2017-12-17T00:08:35.450

9

I've written a Blog post on the SuperUser Blog detailing some of the things you can do to scrape back some hard drive space. Read it at Where did all my hard drive space go?

To summarise, there are many things you can do, depending on whether there is functionality that you need:

  • Don't use hibernation? Then you can disable it and claim back a quantity of hard drive space equal to the amount of RAM you have, you just need to log on as an administrator, open a command prompt and type the following two lines:

    powercfg –h off
    del C:\hiberfil.sys

  • Old Windows Update files can be deleted as the folder they are stored in used to get quite big. They are stored in C:\Windows\SoftwareDistribution but you'll need to go through the method I detailed in the blog to properly clean the directory out.

  • System Restore is another hog and deleting old restore points can clean out space, you can even control how much space is available for use with System Restore

    As an administrator, simply click the Windows Start menu icon, enter “SystemPropertiesProtection.exe”

  • The WinSxS folder is a red herring and contains no data that is not already duplicated elsewhere and deleting it will save you nothing. This special folder contains what is known as a hard links to files which are scattered across your system and are kept in that folder to simplify matters slightly. The hard links take nearly no extra space in the filesystem as they are simply another pointer to already existing file data.

An alternative to the excellent CCleaner that Akira linked is a more commercially supported alternative from IOBits, Advanced SystemCare4. There is a free version available which will likely do just as much to clean out your system as CCleaner, but has a few added extras.

Mokubai

Posted 2011-10-15T09:50:47.417

Reputation: 64 434

Downvoted because these are not symbolic links, but hard links — both names of the file are just as “real”.

– kinokijuf – 2015-09-07T08:18:45.680

@kinokijuf fixed. – Mokubai – 2015-09-07T09:24:36.350

Not fixed! The WinSxS folder data are real; in fact, from the TrustedInstaller perspective, the system files are treated as hard links to the ones in WinSxS! – kinokijuf – 2015-09-07T09:30:46.023

@kinokijuf is it just the word "real" that you object to or do you want it to say something else? I'm happy if you want to suggest a clarification... – Mokubai – 2015-09-07T11:12:06.667

Yes! Downvote retracted. – kinokijuf – 2015-09-07T11:22:45.120

@kinokijuf cheers for that. I admit it does actually read better without that word in there. I'll delete my comments here shortly. – Mokubai – 2015-09-07T11:26:53.057

1@kinokijuf There's no one "real file" when it comes to hard links; the file just has two names. It's not possible to tell which one was the "original." Files are only truly deleted from NTFS when all names/hardlinks are removed. – Ben N – 2016-01-23T22:13:10.780

When you delete a hard link, does the other name still work? Do you reclaim any space on disk? – LastStar007 – 2017-06-27T18:50:05.423

5

Since October 2013 the disk cleanup utility was enhanced with the ability to clean up Service Pack and Windows Update files, this is the safest way to reduce the sized of WinSXS folder.

KB2852386 is what added this feature and most W7 PC's have it installed now.

Cleanup first pass

enter image description here

Click Clean up system files button and this is what you will see.

enter image description here enter image description here

Moab

Posted 2011-10-15T09:50:47.417

Reputation: 54 203

-2

I've been playing with the WinSXS folder in a few test installs and I have figured out a way to save some space. In a 3 month old Windows 7 Pro install on my laptop, the SxS folder grew to 14GB. I can safely delete 7.4GB of that without any issues.

I was a bit surprised to read that most "technical" write ups say you can't delete anything in the SxS folder without issues. This is just not true and I wonder if anyone has tried different scenarios or if that opinion is just grown off of Microsoft's warnings. There is one thing that you can't do after "cleaning" the SxS folder, but it's rare that you'd need to so I won't even waste the keystrokes.

I've had this running smoothly for a LONG time, and on the laptop I use for work as an IT Director, so I put it through it's paces - that's for sure. It's well worth the disk space in some cases. For example -- I love my laptop which is an older Dell and I've got an SSD drive in it. The SSD is only 60 gig, so space is at a premium. As is, I use a 32GB SDCard in the onboard reader to give me extra space, but knocking a chunk of useless crap off is a nice option when you don't need 75% of the files in that folder.

I'll do a write up on it and post it here in the next couple of days.

Cor Bryant

Posted 2011-10-15T09:50:47.417

Reputation: 1

2Just because you haven’t run into any issues doesn’t mean it’ll work for anyone. These files are there for programs to use. Windows itself doesn’t need most of them. – Daniel B – 2015-06-27T10:47:16.623

I think it runs smoothly until you decide to uninstall (or upgrade) something, then it complains about missing files, and you are stuck with software that you are unable to uninstall. – Rolf – 2019-05-29T00:01:59.860