The size of the MSI cache folder (C:\Windows\Installer
) has grown substantially, and is now taking up way too much disk space on my (domain) computers. Can this folder be eliminated or shrunk?
Same question goes for:
C:\WINDOWS\WinSxS
(%SystemRoot%\WinSxS
)C:\System32\DriverStore
(%SystemRoot%\System32\DriverStore
)
Summary
General Disk Space Tips:
Original & Long Answer
Microsoft's piece on space reclamation: Free up drive space in Windows 10
Many further options below. Just the 5-minute emergency procedure I use myself (trivial options).
And obviously empty the recycle bin :-). Also quick to uninstall large, unused software packages.
And check root of C:\ for virtuals and similar uses. Most large files should be in profile hierarchy though.
Reclaim Disc Space - The Pragmatic Options
Recommended real-world quick-options for disc space reclamation:
General:
Removables & Disc Space Visualization
.low-profile USB drive
and / orSD-Card
to your laptop for "permanent", extra storage to move large files to. Generally not high-speed, use accordingly. Note! I find low-profile USB drives may run a bit hot under load. Not for heavy, continuous use IMHO.Find Space Hogs
: https://en.wikipedia.org/wiki/WinDirStat. Visualization tool for disc space consumption. May run slowly on non-SSD disks. Shows what eats your disc.Option 0:
Clouding
. Obviously.OneDrive
,Dropbox
,Google Drive
, etc...Option 2:
Microsoft's Disk Cleanup Tool
. Purge Windows Update files & more.cleanmgr.exe
and press Enter.Clean up System Files
then select system drive and press OK.And one more update:
Downloads
folder (all users).Right Click Folder => Properties => Location
.Compression
(selective folders?). In Folder Properties. May be ultra slow for old disks.Uninstall unnecessary software
. Runappwiz.cpl
from Windows Key + Tap RHigh risk option: Delete outdated and obsolete recovery partition(s) and create a usable partition in its place to keep data on.
Very effective when combined with options
1 (My Documents)
&7 (Downloads)
&11 (Data Heavy Applications)
, etc... Can end in disaster if wrong partition is deleted - of course.To succeed deleting recovery partitions either
diskpart
(Windows) orgparted
(Linux) is likely needed (see "Alternative Approaches" in linked SO answer
).Not for the faint of heart or inexperienced
. Backup is essential!Runners-Up:
Option 4: Administrative Installation
is presented below. Maybe also checkOption 3: (CCleaner)
(not without risk). And a final mention: you can turn off system restore as well (particularly for virtuals). Not listed in linked answer (max lenght).Scavenging / Putting WinSxS on a Diet
The WinSxS folder - Win32 side-by-side assembly store is full of hard links (several shortcuts to the same "physical" file) and often obsolete versions that can never be used (superseded by policy and updates). You can run "Scavenging" - garbage collection for side-by-side Win32 assemblies.
"Find actual size" command that is available since Win 8.1 (from elevated command prompt):
This goes beyond all the hard links in there and finds the actual size of the WinSxS folder - and whether it should be cleaned up.
Run "Scavenging" (from elevated command prompt):
Microsoft's Disk Cleanup Tool:
cleanmgr.exe
seems to kick off "scavenging" sometimes. And there is a scheduled task (Win8 up) - kicking off cleanup. Slightly different from running the command. 30 days grace period before purging, and some timeout issues (ends after 1 hour, regardless).Superuser: Why does the /winsxs folder grow so large, and can it be made smaller?
Administrative Installation
You can't safely delete these files, they are there to facilitate uninstall, modify and repair operations for the installed product. You can, however, greatly reduce the size of the cached MSI files by running an administrative installation (essentially a file extraction) of the MSI before installing it. Follow link above for description - you should put these extracted files on a network share.
The cached MSI files used to be small because they were stripped of their internal CAB files. However, starting with Windows 7 (MSI version 5) the MSI files are now cached full size to avoid breaking the file signature that affects the UAC prompt on setup launch (a known Vista problem). This may cause a tremendous increase in disk space consumption (several gigabytes for some systems).
Running admin install will extract the files from the CAB files embedded in the MSI, adjust the media layout in the Media table in the new MSI so that running it will use the extracted, external source files instead of internal CABs. The new and smaller MSI file used for installation is then cached on the system. This can save several gigabytes of disk space, depending on what installers you use, how many you have to install, how big they are, etc... Keep in mind that you must deal with the UAC prompt issue described above when using admin images since the extracted MSI is (normally) no longer signed, but from a reputable source (your own extraction).
The extracted files and the associated MSI file should be put on a network installation point along with all other installers to ensure files are available for repair operations. This is how most large corporations deal with installation anyway. Then there is no need for embedded CAB files in the cached MSI at all. SCCM and other deployment systems may also have other ways to ensure files are available for repair operations.
Some further links: