Making your windows installation smaller

From Helpful
Jump to navigation Jump to search
Some fragmented windows-related notes (mostly admin stuff)

Windows admin notes

Windows notes - health and statistics|

Special windows variables · special windows folders

Command line windows

Windows and links

Windows user interface tweaks

Troubleshooting when windows spontaneously reboots

Making your windows installation smaller

something taking 100% CPU on windows

TODO: Cleanup

This hasn't been updated for a while, so could be outdated (particularly if it's about something that evolves constantly, such as software or research).


First of all, drive space is almost completely unrelated to sluggishness. even on platter, and even less so on SSD.

Do it only because you are, right now, starting to run out of space, e.g. because your system drive is a smallish 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

By default this mostly cleans up temporary and other non-essential files.

Which may be barely worth it if they're going to get regenerated anyway.


Potentially more interesting is the "clean up system files" section, which can includes


Also consider removing all but the most recent restore point (see More Options -- but apparently has moved elsewhere since then, because why be consistent)

Consider System Protection

System Protection primarily refers to Restore Points for System Restore.

These are a great feature to revert updates when things mess up. If you have the space, just leave this as it is.


At the same time, they will easily take multiple gigabytes (in System Volume Information). so if updates went okay, you could remove the current contents.

If you like to live a little more dangerously and trust that updates always go okay, you can reduce the space allotted to the feature, or even disable it entirely.

(see My Computer → properties → System Protection)

Utilities that clean up

Such as CCleaner and similar.

They know about crud various some specific apps leave behind.


On a brand-new install, this would remove only a few MB.


May potentially clean gigabytes on something you've used for a while and never cleaned this way.

...yet very regular cleaning is almost pointless again

a good portion of it is caches that benefit you and/or will grow to a steady size on use anyway.
you'ld primarily care about the things that are left behind and add up quickly, which is usually relatively little of it.

Visualize the largest directories

Particularly your own files, when you just forgot where they were.

See tools like WizTree, WinDirStat

Remove programs you never use (and can reinstall easily)

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


Less effective, fairly manual, riskier hardcore nerdery, outdated, 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

The "Windows Features" thing since Win7 mostly just disables things and does not actually remove much(verify)

%windir%\SoftwareDistribution

This article/section is a stub — probably a pile of half-sorted notes and is probably a first version, is not well-checked, so may have incorrect bits. (Feel free to ignore, or tell me)

(Part of Windows Update)

tl;dr:

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

Installers, installer caches

MSOCache

MSOCache is a local copy of some 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 may take up on the order of 250MB, sometimes more.


It helps Office do repairs, install patches/updates, and some 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:

%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

Deleting these files 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.

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 least 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.

WinSxS (Vista, 7, 8, 10)

This article/section is a stub — probably a pile of half-sorted notes and is probably a first version, is not well-checked, so may have incorrect bits. (Feel free to ignore, or tell me)

tl;dr: This is core system stuff. Not all of these files are useful, but there is not much you can easily and safely prune.


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 files, particularly the potentially-shared stuff. Used since Vista/7ish.
It helps avoid avoid DLL hell trouble. While it is sometimes overzealous in what it keeps, much of it isn't bloat. So unless you have a particularly small disk, the risks of pruning this are probably not worth the small space gained.
  • Note that the windows directory looks bigger than the storage it actually takes, by easily a few GB (varies), because parts use hardlinks (multiple files on the filesystem that actually point to just one stored copy of the contents[1]).
    • Most utilities, including Microsoft's own (including Explorer itself, at least AOTW) do not understand this, and do not check whether entries are duplicated via hardlinks, so count each copy. To get an idea of actual difference in disk-space use, look for utilities like Hardlink Scanner.
  • 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)
  • The directory is protected, but if you really want you can remove things.
...but you do so at the risk risk breaking some updates, installs, programs, and protection it provides.
  • 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, if you remove naturallanguage6 you break windows search


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 / System Volume Information (Vista, 7, 10)

This article/section is a stub — probably a pile of half-sorted notes and is probably a first version, is not well-checked, so may have incorrect bits. (Feel free to ignore, or tell me)

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)


You can

  • disable System Restore (System Properties)
  • delete current restore points without disabling system restore
  • alter the maximum percentage of disk used for these

See also:


Program Files\WindowsApps