How can I free up drive space from the Windows installer folder without killing Windows?
Solution 1
I created "PatchCleaner" to clean the windows installer directory of all orphaned files in one easy click. If you don't trust the app to do the right thing, use the move feature to put them somewhere safe in case you need them back in the future. I have run it on multiple machines and saved up to 15Gb of space :-)
Run PatchCleaner after windows updates to find newly orphaned files.
I recommend you use the Move action, and move the orphaned patches to external storage, just to be safe
Known Issues (full details on website)
- Adobe Reader can fail to update after running PatchCleaner.
NOTE: as @ Feb-2016 version 1.4.1.0 is out that has a fix to allow customisable filters to exclude adobe reader from being incorrectly detected.
Solution 2
This seems to have worked for me. This is a simplified set of instructions from http://www.kavoir.com/2012/07/how-to-free-up-c-drive-disk-space-in-windows-7-easy.html
- Make sure no installations are running on your machine (there's probably a formal way to do this, but I'm not sure how).
- Copy using Windows explorer C:\Windows\Installer to another disk, e.g., D:\C_DRIVE\Windows\Installer -- note: Windows\Installer is a system folder and thus invisible in Windows 8.1. You have to tweak your account to make it visible to use Explorer to make the copy. Google will help you find out how to do that.
- Make a backup copy of C:\Windows\Installer
-
Type the following commands in a cmd.exe window running as Administrator:
rmdir /s /q C:\Windows\Installer mklink /D C:\Windows\Installer D:\C_DRIVE\Windows\Installer
-
Windows may not let you to delete the installer directory, because some process are using some files within this directory:
C:\Windows\Installer\{some files}.msi - The process cannot access the file because it is being used by another process.
In this case you can use this link and use Process Explorer to find and stop the process which is restricting the rmdir command.
-
Verification
As a verification, I ran a "repair" of my Microsoft Visio Professional 2013 install (took 4 minutes to process). This completed successfully. Windows update (with reboots) also ran successfully after making the above changes. I will write back if anything doesn't work.
Solution 3
You can compress the folder. You will regain between 10 and 20% of the space.
- Enable "Show system files" in Explorer options
- Right-click the installer folder
- Properties
- Click on Advanced
- On the new dialog, select 'Compress'
- Click OK
- Apply for all files and folder
Solution 4
Sometimes $patchcache$ consumes a great deal of "Installer" folder. You can check how big is your "C:\Windows\Installer\$PatchCache$" folder (mine was 6GB after 1.5 years).
Basically it boils down to "If you have original installers, then you could delete it".
rmdir /q /s "C:\WINDOWS\Installer\$PatchCache$" (as admin of course)
read about it: Can I delete the folder "C:\WINDOWS\Installer\$PatchCache$"?
MSDN: http://blogs.msdn.com/b/heaths/archive/2007/01/17/the-patch-cache-and-freeing-space.aspx
Solution 5
There is no official way to kill it. You can use a link to move it to a HDD if you have one.
Related videos on Youtube
DeepSpace101
Updated on September 18, 2022Comments
-
DeepSpace101 over 1 year
On my SSD machine, the
C:\Windows\Installer
folder is massive and takes up about 15% of my total disk space.Is there a way to clean up that folder without killing Windows 8.1/10? Tucking away the installers on the OS partition seems wasteful.
-
Fuhrmanator about 10 yearsI had the problem in Windows 8, and the temporary solution was to upgrade to 8.1 (I had 20+ G free up!). But the problem crept up again, with the continual patching of 8.1... This is an annoying problem from Windows since XP.
-
HopelessN00b about 10 yearsActually, those aren't Windows installers in that folder. It's basically all the stuff that Windows needs to run different programs and code versions.
-
Jay Imerman over 8 yearsAre you kidding me? On my machine, this folder alone takes up over 25% of the disk space (20 GB / 80GB) allocated to the boot volume. Win 2008 R2.
-
Ƭᴇcʜιᴇ007 about 8 yearsRelated/Duplicate from 2009, still relevant: Is it safe to delete from C:\Windows\Installer?
-
Peter VARGA almost 7 yearsYou happy guy! On my system the Installer directory takes 50% of the 95 GB HDD. Microsoft is not acting here like the biggest software company in the world!
-
mcy over 6 yearsIt is almost 2018, we have windows 10 now and it gets 46 GB off the disk for the very same thing :/ some things never change.
-
Rosdi about 6 yearsThe easiest would be to compress the folders as described by Hans below.
-
oliver over 5 yearsToo bad this question's got that silly protection status. What worked for me on Windows 10 is using Unlocker (emptyloop.com/unlocker), which I already had installed because Windows tries to keep its filthy hands on some files. All that is additionally needed is to uncheck "hide system files" in Windows Explorer. Then navigate to the (now visible) Installer folder, right-click->Unlocker and then choose "delete". The deletion took like 10 minutes, but now my SSD is 38 GB (!!!) lighter. Felt like getting to the restroom after a HUGE christmas dinner.
-
Vadzim about 4 years
-
-
Fuhrmanator about 10 yearsI've read from several users this does not work: bitsum.com/junctionmaster.php#comment-1127491034 "The problem is, msiexec (apparently) ignores the junction, and manually creates C:\Windows\Installer. This 1) removes the junction, and 2) completely deletes the contents of the target directory."
-
magicandre1981 about 10 years@Fuhrmanator I used schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html and it works for me.
-
Mladen B. over 9 yearsWouldn't it be better if you first moved "C:\Windows\Installer" to "D:\C_DRIVE\Windows\Installer" and then ran mklink?
-
Fuhrmanator about 9 years@MladenB. Using
move
(as opposed tocopy
then a recursivermdir
) might seem better. The original instructions I cited mention that removing the files can be complicated because you might have to take ownership. I've had to do that before in Windows and it's annoying when there are a lot of files. In such cases, the copy will complete successfully the first time, then you just have to make thermdir
work. ForC:\Windows\Installer
it probably doesn't make a difference, but the cited article speaks of other directories that can be relocated onto a separate drive. -
user3773503 about 9 yearsIt's recommended at least to compress
C:\WINDOWS\Installer\$PatchCache$
or the fullC:\WINDOWS\Installer
folder. The simple step can save really much space on the disk. There are exist many .msp files which are not use cab inside. Such .msp files can be good compressed and one get some disk space for free. I had on my SSD (the only disk on the notebook) 52GB inC:\WINDOWS\Installer
folder which will be only 41GB after the simple compression. -
Fuhrmanator about 9 yearsThere's an interesting approach discussed here: blogs.msdn.com/b/heaths/archive/2014/02/11/… See some of the comments for other alternatives, including a script that does a lot.
-
fluxtendu about 9 yearsThe move option crash PatchCleaner on my side. (don't want to try delete)
-
jcrawfor74 almost 9 yearsBugger. I understand not wanting to use the delete function :-).
-
jcrawfor74 almost 9 yearsUpdated version of software to hopefully fix the crash on using the move. It is generally related to file system permissions. If the move fails make sure you are moving to a location that you have full permissions on, but the update should fix it.
-
George Dima almost 9 yearsthanks, worked perfect, reduced the size from 10GB to 3GB on my install. other tools failed
-
user3382103 almost 9 yearsHow does it know if a file is orphaned or not?
-
jcrawfor74 almost 9 yearsMagic :-). Windows actually keeps a list of known patches that it needs, that can be accessed via WMI calls. I compare this known list against what is actually in the c:\windows\installer directory and anything in the folder that is not in the list is no longer required. I have successfully run this an updated with the lastest windows updates from a few days ago and they all installed successfully. You will get errors if patchcleaner has done something wrong. I would recommend using the move action until you are happy that the program is doing the right thing.
-
JqueryToAddNumbers almost 9 yearsbest method that is perfectly safe. it reduced my folder by 2gb from 12gb
-
Simon D almost 9 yearsSaved 10GB, about 10% of my disk. Thanks
-
Alexander Popov almost 9 yearsGreat tool, really liked it, works seamlessly :)
-
hedgepig almost 9 yearsI assume this works the same in Windows 7? Also, thank you so much for this answer - I've been wanting to clear up space on my C drive for so long but all the search results I get on Google always simply say I can't delete installer files period. Nice workaround :)
-
Ev0oD almost 9 yearsIs there some likelihood that after making this operation, the upcoming upgrade to windows 10 will fail due to this modification?
-
Fuhrmanator almost 9 years@Ev0oD Of course there is some likelihood, but I won't speculate what the probability is. You can weigh the risk of doing this short-term fix with the cost of a long-term fix that probably involves repartitioning (and a brand new install). Anyway, it's always recommended when moving up to a new version of Windows to do a clean install. In my case, I would fix the space problem on my main drive when I reformat it before the upgrade.
-
nietras almost 9 yearsThanks, I had 29GB in this directory and it was reduced to 10GB.
-
zukanta over 8 yearsJust saved up 17 gigs on a chocking SSD. Beautiful tool, thanks!
-
chronometric over 8 yearsNice one, I install almost entirely from physical installers, so this was a good 5gb out of my problem! Thanks x3
-
fixer1234 over 8 yearsWelcome to SU and thanks for the contribution. Just a heads up, SU gets a lot of spam, and it typically reads like your answer. It's a safe bet you're not a spammer, given your history on SO, but link-only product recommendations attract downvotes and are usually deleted. Good guidance here on recommending software.
-
bwDraco over 8 yearsPlease exercise caution when recommending software. As written, your answer may be seen as spam. Your answer should include a description of the software and how it addresses the question. More information: How do I recommend software in my answers?
-
hatranpro over 8 yearsThanks @fixer1234 @ DragonLord I will practice the recommended tips next time.
-
RedX over 8 yearsDo you think it would be possible to create a portable version of this tool?
-
Mian Asbat Ahmad over 8 yearsTo view C:\Windows\Installer folder, uncheck the Hide protected operating system files option in the folder options.
-
Terry over 8 yearsNice looking little piece of software too, +1 for simple interface
-
Syaiful Nizam Yahya about 8 yearsUsed this method on my Windows 10. So far so good.
-
Ben Johnson about 8 yearsVery grateful to you for this tool; it reduced C:\Windows\Installer from 8.4GB to 4.8GB in my case. As others have stated, the UI is slick and simple. I will be donating to you.
-
Adam Colbert almost 8 yearsAwesome! 20 GB freed out of nowhere! I moved them to an external hard drive in case I need them. Thanks a lot! :)
-
zrisher almost 8 yearsWhy on earth does Windows need to cache all the installation files for its various managed installs in one place, anyway? Wouldn't it be significantly more disk-efficient to just store a signature, verify an install matches the signature, and download any needed files from the internet?
-
trapicki almost 8 years@Fuhrmanator With my Windows 7, I had to save and restore the original the permissions afterwards. Before moving:
icacls C:\WindowsInstaller /save Installer.acl
After moving:icacls D:\C_DRIVE\Windows\Installer /restore Installer.acl
. Otherwise installers would not be able to access the directory and report an error 1632. -
Flion almost 8 yearsyup perfect, took a while to start up though (or I didnt see the screen anywhere). But cleared up a lot of space!
-
SandRock over 7 years@hatranpro I would like to suggest practicing the recommended tips on this question by editing it. Now.
-
deroby over 7 yearsOn my previous laptop I had a smallish SSD and larger HDD. I moved it all to the HDD and created a link. Worked perfectly. (Win10 64bit)
-
bastijn over 7 yearsOr just browse directly to it and right-click in the empty space.
-
Dunc over 7 yearsSafer way to do this IMHO by booting into Command Prompt and using
robocopy
, otherwise you may get locked files superuser.com/a/937748/18118 -
ysap over 7 yearsThis method is not really useful for a laptop, or a single disk desktop, right?
-
Fuhrmanator over 7 years@ysap if there is space on another partition of the SSD, it's useful.
-
Andrea over 7 yearsI found this answer really useful: after enabling compression my "Installer" folder shrinked from 46.5GB to 38.9GB (the compression process took about 1 hour)
-
ivan_pozdeev over 7 yearsWARNING! This wouldn't work in XP. When I tried and made
C:\Windows\Installer
a junction point, msiexec broke it and recreated the folder anew. -
ivan_pozdeev over 7 yearsThis utility DOES NOT do what the OP requested. It doesn't "free up space in Windows Installer folder" by deleteing unused files. Instead, it deletes used files and registry metadata. Read its description at technet.microsoft.com/en-us/library/… .
-
ivan_pozdeev over 7 years@jcrawfor74 what about patches that are referenced in registry but don't belong to any installed product? Are they "orphaned", too?
-
Evgeny Gorb over 7 yearsI executed WICleanup tool after Patch Cleaner and it found more unused files (Patch Cleaner found 22+ Gb and WICleanup 5+ Gb more)
-
magicandre1981 over 7 years@EvgenyGorb congrates for damaging Windows. WICleanup is 32bit and only works fine in 32bit Windows, all 64bit MSI files are threaten as removable.
-
magicandre1981 over 7 years@jcrawfor74 do you plan to clean the folder C:\ProgramData\Package Cache where the MSI/MSP files are stored which are created with new WIX tools?
-
Evgeny Gorb over 7 years@magicandre1981: Thank for the reply. It's good that I just scanned for the files without removing them)
-
saintali over 7 yearsThat's
COMPACT /C /S:C:\Windows\Installer
. -
chronometric about 7 years@RedX There is a portable version available on the project's SourceForge page: sourceforge.net/projects/patchcleaner/files/…
-
chronometric about 7 yearsThis is an occasionally useful program for those who don't run an installation manager, but indeed it has nothing to do with the install packages being discussed here. It simply allows you to remove package entries from the Add/Remove Programs list, useful if they are orphaned or the uninstall info corrupted (re-install to replace this info). PatchCleaner is elegant and effective, look no further.
-
Gravity about 7 yearsnote: this programrequired .net!
-
user30747 almost 7 yearsRecovered 30.44 GB. Thanks for the tool! Would be nice if it was libre software; it would have eased the trust question ;)
-
ivan_pozdeev almost 7 years
-
Sergei Gorbikov almost 7 yearswas unable to access the URL (This site can’t be reached) on 26 Aug 2017
-
Damon over 6 years@ivan_pozdeev a junction is different than a hard link. I use a small program called junction.exe to make it work from docs.microsoft.com/en-us/sysinternals/downloads/junction
-
ivan_pozdeev over 6 yearsReciting the comment on the link: WARNING! This wouldn't work in XP. I once tried and made
C:\Windows\Installer
a junction point, andmsiexec
broke it and recreated the folder anew. -
ivan_pozdeev over 6 yearsYes, I'm speaking specifically about a junction. XP doesn't support symbolic links. (The solution on the link speaks about symbolic links, not hard links.)
-
Damon over 6 years@ivan_pozdeev I have to admit, my memory is foggy now so I will definitely take your word for it! I seem to remember doing this originally on XP though and it working for and extended period of time (yrs). But I'd believe you first!
-
ivan_pozdeev over 6 yearsI definitely remember being foolish enough to delete the moved folder when Windows Installer recreated it at the old place, and having to spend a few days at a later point searching for those files on the Net and restoring them to be able to manage the installed products again. I even composed some Python code to save time on routine actions. That was on XP x64 though -- maybe x32 XP has this bug fixed. Or maybe you were just lucky to have never triggered it.
-
divenex over 6 yearsFreed 24 GB of junk in my Windows 10 folder and everything works perfectly. Many thanks!
-
vanessa over 6 years@jcrawfor74 You are a great man. The tool just helped me to recover 75 GB of 110 GB total, Windows 7. Thank you.
-
Rosdi about 6 yearsI went beserk, I compressed the entire
c:\Windows
folder,Program Files
, andUsers
folder. My free space went up from 3Gb to 17Gb... woot!! -
John Alexiou almost 6 yearsYou can check if there is an install running by looking for a
msiexec
process running. -
A Khudairy over 5 yearsThaaanks! I just moved 56 GB to a different drive (windows 8.1). I am wondering if the folder link would also work fine like the solution suggested by "Fuhrmanator". It is very strange that windows doesn't provide a solution for this.
-
IvanH over 5 yearsIt is necessary to enable vbscript in windows 10 (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows Script Host\Settings) Fix: Windows Script Host access is disabled on this machine
-
Erik Johnson over 5 yearsFor me, that's 32GB of the 37GB in the Installer directory. Good pointer.
-
Shady Mohamed Sherif about 5 yearswhy this tool isn't popular. why Ccleaner isn't including it to their product? Try to sell it to them and make some money man
-
treckstar about 5 yearsThis should definitely be the selected answer, as it provides a very safe solution to the question asked.
-
Amessihel over 4 yearsThanks, although this way is bothering: it's like moving dust instead of cleaning it. :-/
-
Teejay almost 4 yearsThanks, at least I freed up 2.5 GB of about 20.
-
z2z over 3 yearsGreat tool, must have for windows users.
-
mrmut over 3 yearsMay the blessings and good grace of good of IT be upon you!
-
Ravindra Bawane about 3 yearsPatch Cleaner has not been updated since 2016 and more recent reports indicate it is no longer as accurate at identifying whether files are or are not required any longer.
-
spikey_richie almost 3 yearsJust used it to good effect, reducing a 60.9GB folder down to 7.7GB
-
mrmut almost 3 years@spikey_richie I second this. I used this tool on dozens of PCs now, with great success. Storage gains are MASSIVE. It is perplexing that Windows don't know how to do this themselves.
-
user1696603 about 2 yearsNote: this folder can't be seen by all commands from command prompt,
dir "C:\Windows\Installer\$PatchCache$"
yields file not found. It works fine from Explorer though,explorer "C:\Windows\Installer\$PatchCache$"
.