Safely remove files from Windows 7 system folders?

5

2

My Windows folder is 20 GB big. How do I safely detect and remove unnecessary files?

Specifically, I'm looking at:

  • /Windows/Installer, which is 7 GB
  • /Windows/WinSxS, which is 4 GB

I do not want to buy an external or internal HDD or use a CD as a HDD! Stop to advise that!

UPDATE

I've found a pretty useful utility, WinsxsLite. It can decrease the size of the WinSxS folder.

hazzik

Posted 2011-08-31T13:55:04.843

Reputation: 158

Even if there were, I would be leery of it. Let's say the tool identifies some drivers that you don't need for your hardware. Or a service that it thinks you don't need. Then next month you get new hardware or a program that uses that service. At best you will be restoring those files from media. More likely you will be tracking down some enigmatic error. If HD space is an issue, imo the money to buy an extra drive is likely to pay for itself in missing headaches later. – EBGreen – 2011-08-31T14:03:21.123

Use CCleaner, and next time before you install Windows, make a custom installation using RT7Lite. – Breakthrough – 2011-08-31T14:09:35.857

Use windows shipped Disk Cleanup. – avirk – 2011-08-31T14:11:23.030

@EBGreen, I cannt buy a new HDD, `cause it is notebook:( – hazzik – 2011-08-31T14:12:43.660

@avirk already, but it did not help – hazzik – 2011-08-31T14:13:41.443

You can buy external USB HDD for notebooks. There are some tools that can measure for you which is the big folder in your drive and let it to delete you. Advance System Care is one of them I use and it has extra features which you will like. – avirk – 2011-08-31T14:21:44.823

Actually you can add a 2nd HDD. Take a look at this blog post on using the optical drive as a hard drive! http://blog.superuser.com/2011/06/30/installing-the-optical-bay-hdd/

– Simon Sheehan – 2011-08-31T14:29:01.160

Stop to advise me to buy HDD, question is not about that! – hazzik – 2011-08-31T14:38:33.103

If you are pushing 4 or 5GB of free space, then you should think about getting a larger HD. A 500 GB is less than 100 US. – surfasb – 2011-08-31T15:01:50.023

My de-ure month salary is about 200US$ stop to advise this!!! – hazzik – 2011-08-31T15:12:05.407

Just to point out that the winsx can and will grow, and cannot be relocated, so the "good" news for hazzik is that a 2nd hard drive will not help this problem at all. I personally had a 16GB sxs folder under vista. – horatio – 2011-08-31T20:21:18.310

@hazziz: per your new comment about winsxslite, you should be aware that the hard linking ( http://www.techk2.com/tutorial/winsxslite-first-application-to-address-winsxs-size-problem/ ) described here is what winsxs does already. The idea is to allow windows to swap in older compatible versions of packages so programs will run properly. Your program will remove these old versions and har link them all as the most recent version. This is actually counter tio the intent and design of winsxs functionality AFAIK.

– horatio – 2011-09-01T16:28:06.837

I guess I am trying to say "don't be surprised if something breaks" – horatio – 2011-09-01T16:28:40.063

@horatio as I understand WinsxsLite it relink only exactly same files (by md5 hash) – hazzik – 2011-09-01T17:47:51.967

@hazzik: The article says "Second Phase will replace all version of each and every file stored in WinSXS folder and will create hard link to highest version of file in program location or other location." Of course, the article might not be written by author, not sure. – horatio – 2011-09-01T19:27:52.547

Answers

6

You don't want to manually remove entries from those folders.

Windows 7 saves it's installer packages (much like a c:\i386 folder on an XP machine) locally so that you don't need to insert the win7 disk when installing updates or running repairs.

Also, Windows 7 uses a central directory to store most of the files that make up the operating system itself and then places what are essentially shortcuts or pointers to those files in the places where the files are actually used. This makes it pretty easy to maintain critical file versions and greatly simplifies updates. This also makes for a single very very large folder inside your Windows directory that you should not, ever, ever no never, modify or delete unless you want the wrath of the Gates to fall upon you. Or something like that.

All that being said, using CCleaner and selecting the option to remove Hotfix uninstallers should remove the uninstall packages for any patches you've installed. Since the patched files are already in the windows installer source directory, and as long as a recent patch hasn't bolluxed up your system, this may help get things cleaned up.

One final not though: 20GB isn't all that much more than a standard Windows 7 install. It's unlikely you're going to get much smaller than this.

UPDATE CCleaner revision: Ok, it appears as though, once Windows 7 applies the patches, the necessary source files are integrated into the windows files repository and any extraneous patch files are removed. So CCleaner does not have the 'Hotfix Uninstaller' option in Windows 7 that it has in XP.

The only thing I'd be careful of removing are the Windows Log Files. Everything else listed in CCleaner should be OK to be deleted so long as you know what it is you're deleting (if you rely on your jump lists or MRU logs, CCleaner only knows that if you tell it not to delete them.

But like I said, those folder sizes are not outside the realm of normal in the Windows 7 world.

music2myear

Posted 2011-08-31T13:55:04.843

Reputation: 34 957

"using CCleaner and selecting the option to remove Hotfix uninstallers" I cannot find that option in CCleaner – hazzik – 2011-08-31T14:34:11.100

3

DO NOT FOOL WITH WINSXS

This ( http://www.winvistaclub.com/f16.html ) website describes something that may be helpful regarding winsxs:

The only way to safely reduce the size of the WinSxS folder is to reduce the set of possible actions that the system can take – the easiest way to do that is to remove the packages that installed the components in the first place. This can be done by uninstalling superseded versions of packages that are on your system.

Which means uninstall programs I suppose.

Also the following might help reduce winsxs folder size

Service Pack 1 contains a binary called VSP1CLN.EXE, a tool that will make the Service Pack package permanent (not removable) on your system, and remove the RTM versions of all superseded components. This can only be done because by making the Service Pack permanent we can guarantee that we won’t ever need the RTM versions.

horatio

Posted 2011-08-31T13:55:04.843

Reputation: 3 345

1

The WinSxS folder doesn't use 4GB. It's a summary list of installed DLLs, and those DLLs together are 4gb. Even if you'd remove the list in WinSxS, the files would still exist somewhere else on the disk, and still take up the same 4GB of space.

The underlying technology is NTFS "hard links" (as opposed to shortcuts, which are are considered "soft links"). With hard links, one file can appear under multiple names in multiple directories. If you delete one name, the file remains on disk; you need to delete all names to free the diskspace.

The advantage for Microsoft is that they can more easily fix security risks this way. They only need to check WinSxS for bad DLL versions; if found there they can just overwrite that. All other names on disk will refer to the same bytes, and therefore are updated too.

MSalters

Posted 2011-08-31T13:55:04.843

Reputation: 7 587