Making your windows installation smaller

From Helpful
Jump to navigation Jump to search
For more articles related to mucking about with windows:

See also: Category:Windows

Template:Feelfree


First of all, drive space is almost completely unrelated to sluggishness.

Do it because you are, right now, starting to run out of space (or perhaps to avoid that on an SSD).


Some of the easier, more effective things

Most of these things clean up crud that builds up, so only need to be done once in a while, or just once.


Window's Disk Cleanup utility

In particular, use

  • its More Options to remove all but the most recent restore point (if you want to)
  • its Clean up system files to clean up after windows update, or after updating windows

Utilities that clean up

Such as CCleaner and similar utilities

Removes

only a few MB on a brand-new install
more on something you've used for a while and never cleaned this way, and
almost nothing if you do this regularly

See where large documents are

Particularly your own files that you just forgot were there.

See tools like:

Remove programs you never use (and can reinstall easily)

Such as big games you haven't played in a while.


Less effective, more manual, riskier hardcore nerdery, only in old versions, etc.

Many other things have less effect, and/or require more hardcore (and potentially dangerous) nerdery.


Removing all but the most recent Java update

actually recommended on the java site itself



Removing windows components you don't need

...though this hardly makes a dent. On XP you could strip ~200MB of things you probably never used


Note that the "Windows Features" thing in Win7 often just disables things and does not remove them(verify)


WinSxS (Vista, 7, 8, 10)

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

tl;dr: Yes, it's large, and not all of it is useful, but there is little safe pruning


Some possible cleanup:

  • If you have installed language packs you don't use, you can use lpksetup.exe to remove them.
  • Win7: If you have updated to SP1, you can use dism to clean up a bit (verify)
  • Vista: If you have SP1, you can clean a bunch of files that are only necessary to uninstall this service pack. Look for vsp1cln.exe (part of the service pack).

Beyond that, don't mess with it. (you can skip reading the rest of this section)


Summary:

  • "Side by side" (SxS) is how windows organizes its components and (DLLcache-like) backup filess, particularly the potentially shared stuff.

Primarily used in Vista, 7, and 8.

  • The windows directory looks bigger than it is (varies, but easily by a few GB), because various parts it use hardlinks (multiple files on the filesystem that actually point to just one stored copy of the contents).
    • Most utilities (including Explorer itself, at least right now) do not understand hardlinks when counting size, so simply counts double/triple/etc. To get an idea of actual disk-space use, look for utilities like Hardlink Scanner.
  • WinSxS is functional. It helps avoid avoid DLL hell-like trouble. While it is sometimes overzealous in what it keeps, a lot of it isn't bloat. Unless you have a particularly small disk, the risks of pruning are probably not worth the small space gained.
  • WinSxS contains
    • windows's current system files (System32 and SysWOW64 have a bunch of hardlinks into WinSxS)
    • other programs hardlink to libraries they install into SxS
    • a good chunk of the windows install DVD (so that you won't have to grab it later)
    • what was previously the DLLcache is now Winsxs\Backup (sort of)
  • You can remove things from this directory, in that you can manage to remove the protection.
...you do so at the risk risk breaking some updates, installs, and programs.
  • For most things in there, there is no automated cleanup, not even of components you don't use. You can try manual deletion, but it's risky unless you know for sure it's not.
For example, you break search if you remove naturallanguage6


%windir%\SoftwareDistribution

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

(Part of Windows Update?(verify))

tl;dr:

  • \Downloads seems to be fairly safe to clear - assuming it's not in use right that moment.
  • Don't touch the other parts.


Installers, installer caches

%windir%\Installer (WinXP, Win7, more?)

Usually meaning C:\Windows\Installer


Can easily contain a few hundred MB to 1GB or so of installers, all named something like 46b0ca2.msi

Leave this alone, unless it's last-minute touch-up of kiosk images or so.

You can delete these files, but doing so usually means the program it belongs to will not uninstall anymore, and possibly not update, which may be more bother in the long run than a couple hundred MB is worth.

You may wish to leave anything that may update/change regularly (iTunes, Silverlight, Office, etc. - which are some of the largest) alone.
The various smaller ones add up too. You could go through them if you have too much time.


To find out what each of these is

  • right-click, properties, details will sometimes show a clear name.
  • ...if not, you could run them, since almost all installers will gives a 'repair, uninstall, cancel' window before they do anything. Not everything, though...


Some of these files compress well, but most don't. You may be able to shave off a few hundred MB, and it won't affect speed of anything but the fairly rare event of uninstalls and updates.


Apple's Installer Cache

(Somewhere in the All Users profile, though the exact path seems to vary a little)

Usually a few dozen MB (for iTunes, Quicktime) up to perhaps 600MB (many old versions of iTunes, Quicktime, Safari).

It seems that you can delete at leas the old versions you don't have installed anymore.

There seem to be other places Apple places installers for different software (the background services it adds, iPhone updates)(verify).


Chrome versions/installers

tl;dr: No need / no point. But you can.


Somewhere under a user's App Data, there's a Chrome\Application directory which contains chrome.exe, and two \version directories, each of which include an \Installer directory.

Chrome stores the current version and one old one, presumably to transparently fall back in case of problems. It automatically cleans up older versions. So while there's (order-of-magnitude) 200MB that isn't being used, it's a feature, it won't grow, and you'll get a new version on every minor chrome update.

MSOCache

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

MSOCache is a local copy of MicroSoft Office installation files, which Office's setup copies to in the root of one of your partitions when, at install time, it decides there's enough space for it.

It often takes up on the order of 250MB, sometimes more.

It helps Office do repairs, install patches/updates, and component (re)installs without needing the CD.

The MSOCache is one Local Installation Source (LIS) set (of which there may be more than one(verify)).


Not creating

You can ask installers for some (but not all - which?(verify)) Office versions that you don't want this cache.


Removing

You can remove the directory. If you do, know where your office CD is.

If you delete, Microsoft suggests you don't do it manually using Explorer, but with the standard windows Disk Cleanup utility (do Disk Cleaning for the drive the MSOcache is on and manually check the option 'Office setup files').


Moving

If you e.g. have a cramped system drive and a separate large storage drive, then it can make sense to move the LIS caches.

You can do this cleanly using the LIS tool:


See also

Microsoft pages:

Other pages:

Removing windows update files (XP)

...those that are useful only for reverts.

(mostly for XP, not so much under Vista and Win7 and later)

CCleaner can do this, as can various other things. If you know what you're doing you can do it manually.


The windows DLLCache (XP)

tl;dr: Safe to remove, but doesn't remove much and it saves you grabbing your install CD. Probably best to leave alone.

(...unless you're making netboot images for kiosk installs or such)


Purpose

The DLL cache is part of Windows File Protection (WFP) used in Windows NT, 2K, 2K3, XP, and somewhat differently in Vista and Windows 7(verify).


WFP keeps an eye on system files (DLLs and more) and will notice (based on signatures) when such files are replaced, and transparently and quietly puts back the most proper version (that is knows of and has). This protects you from e.g. old installer programs that blindly overwrite system files with old/bad versions because they were meant for older or other versions of windows. (over time it's become infeasible to even expect these installers to check)


The major source of these good versions is the DLL cache. This is why you generally want to keep it, unless you really really need the 200MB to 500MB that the cache typically takes.


Notes:

WFP is a convenience feature, not a security feature. Once a program is allowed to write to the windows directory, it can usually also write to the DLL cache and everything else in your system, so if a program is malevolent (malware, virsuses) it can usually circumvent this well enough.
WFP looks for files in the DLL cache, the driver cache, the installation medium (which may be a copy of the install CD on a local directory, or network directory), and failing all of those will fall back to asking you for your install CD.
It probably also looks in the directories for hotfixes, since those register new DLL versions with WFP too.
SFC.exe (System File Checker) refers to a run-once command that does the same thing, which you can e.g. set to run at bootup. (It was apparently introduced in Win98, which didn't have the WFP as a service yet.)


DLLcache size, settings, and emptying

Unless and until a size limit is explicitly set, the dllcache will easily grow to a few hundred MB, depending on the variety of installs you do, hardware you plug in, and such. It shouldn't grow much beyond 500MB as there are only so many files to protect.

Different versions of windows also have (varying) implicit limits - none should completely fill op your drive.


You can also change most settings in the policy editor in Computer Configuration/Administrative Templates/System/Windows File Protection.


A number of these can also be set with the sfc.exe utility, which primarily lets you:

  • empty the cache: sfc /purgecache. Can be handy when you suspect something in it is corrupt. Alternatively, you can just delete the files in the dllcache directory.
  • set a limit on its size: sfc /cachesize=100 The number is interpreted as megabytes.
  • trigger a check: sfc /scannow

(...and a few other things). See sfc.exe /? for more details. You'll need a windows command prompt.


You can move the DLLcache - the directory it's in is looked up via a registry entry.



See also


Driver cache (XP)

tl;dr: You usually do not want to remove this.


The driver cache is a set of commonly useful drivers, such as low-level hardware that may change (ports enabled in the BIOS and such), support for basic USB device types, and more. The driver cache means installation of these things can go fluidly, often transparently (without prompts to you), by having these files always be fetchable from this cache.

It's at %SystemRoot%\Driver Cache\i386\driver.cab (by default; it is pointed to by a registry key). Windows service packs may store additional driver cabinets in the same directory, for example sp2.cab.


You can delete the driver cache if you are really pressed for space - but doing so will disable installation of a lot of (lower-level) hardware to be transparent to the user.

Disabling such previously automatic hardware installation is potentially useful for some admins, because it will now ask to look in other places, and for admin credentials to install. In short, you can use it to prevent users from installing their own devices. This is usually not necessary, it may include USB sticks and make your users very unhappy, and in some cases you may just be creating a lot of extra work for yourself.

Some notes

on Windows 10

Windows 10 is cleverer about being compact than earlier versions, including compression, so there's less to be won in the details.

Of course, remove any programs/apps you don't use.


If you did an update, it kept the previous windows copy, probably taking on the order of 10GB. You can use Disk Cleanup to remove that.


on Shadow Copy (Vista, 7)

This article/section is a stub — some half-sorted notes, not necessarily checked, not necessarily correct. Feel free to ignore, or tell me about it.

Says microsoft: "The Volume Shadow Copy Service provides the backup infrastructure for the Microsoft Windows XP and Microsoft Windows Server 2003 operating systems, as well as a mechanism for creating consistent point-in-time copies of data known as shadow copies."


It has existed since the later days of XP, but in Vista and Win7 it has more integration, and more things use it.

It supports:

  • System Restore,
  • 'Previous Versions' tab for files & dirs
  • Certain backup programs (and the filesystem-level implementation (NTFS-only?) avoids locking problems)


You can clear them, change the maximum size allocated to it (usually a percentage of your disk size)

If you have WinDirStat/WizTree/Sequoiaview or such, you'll see these inside System Volume Information (on NTFS filesystems, at least)


See also: