470

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.

DeepSpace101
  • 8,787
  • 12
  • 44
  • 47
  • 2
    I 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. – Fuhrmanator Apr 22 '14 at 21:02
  • 1
    Actually, those aren't Windows installers in that folder. It's basically all the stuff that Windows needs to run different programs and code versions. – HopelessN00b Apr 22 '14 at 22:00
  • 3
    Are 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. – Jay Imerman Nov 06 '15 at 15:13
  • Related/Duplicate from 2009, still relevant: [Is it safe to delete from C:\Windows\Installer?](http://superuser.com/questions/23479/is-it-safe-to-delete-from-c-windows-installer) – Ƭᴇcʜιᴇ007 Mar 09 '16 at 04:16
  • 4
    You 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! – Peter VARGA Aug 10 '17 at 09:03
  • 3
    It 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. – mcy Dec 11 '17 at 13:18
  • The easiest would be to compress the folders as described by Hans below. – Rosdi Mar 17 '18 at 16:53
  • 1
    Too bad this question's got that silly protection status. What worked for me on Windows 10 is using Unlocker (http://www.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. – oliver Nov 29 '18 at 19:22
  • Related: [Reclaiming disk space on Windows](https://superuser.com/questions/8141/reclaiming-disk-space-on-windows) and [My Windows folder takes up too much space - how can I reduce it?](https://superuser.com/questions/378695/my-windows-folder-takes-up-too-much-space-how-can-i-reduce-it). – Vadzim Apr 21 '20 at 21:32

9 Answers9

269

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

PatchCleaner @ HomeDev

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.

jcrawfor74
  • 3,277
  • 1
  • 13
  • 6
  • The move option crash PatchCleaner on my side. (don't want to try delete) – fluxtendu May 30 '15 at 16:14
  • Bugger. I understand not wanting to use the delete function :-). – jcrawfor74 Jun 01 '15 at 12:16
  • I will do some testing as the product should catch the error. Sometimes it can be due to attributes on the files, like read-only and hidden attributes. It may have logged some errors into the installation folder, c:\program files (x86)\HomeDev\PatchCleaner. If you want to email me via the contact form on my webpage, I would be happy to work through fixing the glitch. Someone 1+'d it so it could be something special to your setup :-) – jcrawfor74 Jun 01 '15 at 12:28
  • Updated 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. – jcrawfor74 Jun 02 '15 at 10:46
  • thanks, worked perfect, reduced the size from 10GB to 3GB on my install. other tools failed – George Dima Jun 04 '15 at 17:21
  • 1
    How does it know if a file is orphaned or not? – Kevin Doyon Jun 10 '15 at 19:40
  • 6
    Magic :-). 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. – jcrawfor74 Jun 12 '15 at 10:13
  • 16
    Great tool, really liked it, works seamlessly :) – Alexander Popov Jul 15 '15 at 08:35
  • 1
    Thanks, I had 29GB in this directory and it was reduced to 10GB. – nietras Aug 19 '15 at 09:45
  • 2
    Just saved up 17 gigs on a chocking SSD. Beautiful tool, thanks! – zukanta Sep 11 '15 at 17:07
  • 18
    Do you think it would be possible to create a portable version of this tool? – RedX Dec 09 '15 at 07:59
  • Nice looking little piece of software too, +1 for simple interface – Terry Feb 02 '16 at 13:57
  • Very 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. – Ben Johnson May 04 '16 at 20:16
  • Awesome! 20 GB freed out of nowhere! I moved them to an external hard drive in case I need them. Thanks a lot! :) – Kounavi Jun 01 '16 at 21:16
  • yup perfect, took a while to start up though (or I didnt see the screen anywhere). But cleared up a lot of space! – Flion Aug 06 '16 at 12:12
  • 1
    @jcrawfor74 what about patches that are referenced in registry but don't belong to any installed product? Are they "orphaned", too? – ivan_pozdeev Jan 06 '17 at 09:26
  • I executed WICleanup tool after Patch Cleaner and it found more unused files (Patch Cleaner found 22+ Gb and WICleanup 5+ Gb more) – Evgeny Gorb Jan 10 '17 at 12:13
  • 1
    @EvgenyGorb congrates for damaging Windows. WICleanup is 32bit and only works fine in 32bit Windows, all 64bit MSI files are threaten as removable. – magicandre1981 Feb 04 '17 at 09:18
  • 2
    @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? – magicandre1981 Feb 04 '17 at 09:19
  • @magicandre1981: Thank for the reply. It's good that I just scanned for the files without removing them) – Evgeny Gorb Feb 06 '17 at 09:49
  • 1
    @RedX There is a portable version available on the project's SourceForge page: https://sourceforge.net/projects/patchcleaner/files/PatchCleaner_Portable/ – chronometric Mar 24 '17 at 18:45
  • note: this programrequired .net! – Gabriel Mar 31 '17 at 08:44
  • 7
    Recovered 30.44 GB. Thanks for the tool! Would be nice if it was libre software; it would have eased the trust question ;) – user30747 Jul 17 '17 at 19:10
  • was unable to access the URL (This site can’t be reached) on 26 Aug 2017 – Sergei Gorbikov Aug 26 '17 at 18:34
  • Freed 24 GB of junk in my Windows 10 folder and everything works perfectly. Many thanks! – divenex Oct 19 '17 at 15:17
  • 2
    @jcrawfor74 You are a great man. The tool just helped me to recover 75 GB of 110 GB total, Windows 7. Thank you. – yakunins Feb 23 '18 at 20:48
  • 1
    Thaaanks! 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. – A Khudairy Oct 22 '18 at 10:50
  • It 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](https://www.thewindowsclub.com/windows-script-host-access-is-disabled-on-this-machine) – IvanH Jan 04 '19 at 08:35
  • 3
    why 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 – Shady Mohamed Sherif Mar 16 '19 at 12:46
  • 1
    This should definitely be the selected answer, as it provides a very safe solution to the question asked. – treckstar Mar 16 '19 at 18:38
  • Great tool, must have for windows users. – z2z Dec 18 '20 at 03:33
  • May the blessings and good grace of good of IT be upon you! – mrmut Mar 01 '21 at 08:23
  • Patch 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. – music2myear Apr 13 '21 at 18:12
  • 1
    Just used it to good effect, reducing a 60.9GB folder down to 7.7GB – spikey_richie Aug 04 '21 at 07:22
  • @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. – mrmut Aug 05 '21 at 10:17
  • Used this tool and love it. For clarity, the tool scans and then lists 3 types of files "still used", "excluded by filters", and "orphaned" -> the Delete button only deletes the orphaned files. To me that was unclear. – paulguy Jan 04 '23 at 03:01
232

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.

Fuhrmanator
  • 2,869
  • 4
  • 22
  • 33
  • 6
    Wouldn't it be better if you first moved "C:\Windows\Installer" to "D:\C_DRIVE\Windows\Installer" and then ran mklink? – Mladen B. Feb 24 '15 at 11:02
  • 2
    @MladenB. Using `move` (as opposed to `copy` then a recursive `rmdir`) 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 the `rmdir` work. For `C:\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. – Fuhrmanator May 10 '15 at 11:39
  • 3
    It's recommended at least to compress `C:\WINDOWS\Installer\$PatchCache$` or the full `C:\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 in `C:\WINDOWS\Installer` folder which will be only 41GB after the simple compression. – Oleg May 18 '15 at 09:07
  • 1
    There's an interesting approach discussed here: http://blogs.msdn.com/b/heaths/archive/2014/02/11/how-to-relocate-the-package-cache.aspx See some of the comments for other alternatives, including a script that does a lot. – Fuhrmanator May 21 '15 at 20:20
  • I 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 :) – hedgepig Jul 17 '15 at 18:12
  • Is there some likelihood that after making this operation, the upcoming upgrade to windows 10 will fail due to this modification? – Ev0oD Jul 27 '15 at 15:41
  • @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. – Fuhrmanator Aug 04 '15 at 19:19
  • Used this method on my Windows 10. So far so good. – Syaiful Nizam Yahya Mar 22 '16 at 15:06
  • 1
    Why 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? – zrisher Jul 20 '16 at 21:35
  • 6
    @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. – trapicki Jul 22 '16 at 07:40
  • Safer way to do this IMHO by booting into Command Prompt and using `robocopy`, otherwise you may get locked files http://superuser.com/a/937748/18118 – Dunc Oct 19 '16 at 09:30
  • This method is not really useful for a laptop, or a single disk desktop, right? – ysap Nov 05 '16 at 12:12
  • @ysap if there is space on another *partition* of the SSD, it's useful. – Fuhrmanator Nov 05 '16 at 12:26
  • 1
    WARNING! 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 Jan 05 '17 at 21:55
  • You can check if there is an install running by looking for a `msiexec` process running. – John Alexiou Jun 21 '18 at 15:02
  • Thanks, although this way is bothering: it's like moving dust instead of cleaning it. :-/ – Amessihel Jan 23 '20 at 15:51
  • Does this method still work for Windows 10/11? – Param Siddharth Apr 15 '23 at 16:51
98

You can compress the folder. You will regain between 10 and 20% of the space.

  1. Enable "Show system files" in Explorer options
  2. Right-click the installer folder
  3. Properties
  4. Click on Advanced
  5. On the new dialog, select 'Compress'
  6. Click OK
  7. Apply for all files and folder
Hans
  • 991
  • 6
  • 2
15

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

Al-Mothafar
  • 103
  • 4
Max
  • 318
  • 3
  • 13
  • 1
    Nice one, I install almost entirely from physical installers, so this was a good 5gb out of my problem! Thanks x3 – chronometric Sep 25 '15 at 14:36
  • 1
    For me, that's 32GB of the 37GB in the Installer directory. Good pointer. – Erik Johnson Feb 26 '19 at 00:02
  • Note: 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$"`. – matt wilkie Mar 15 '22 at 18:25
8

There is no official way to kill it. You can use a link to move it to a HDD if you have one.

magicandre1981
  • 97,301
  • 30
  • 179
  • 245
  • I've read from several users this does not work: http://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." – Fuhrmanator Apr 22 '14 at 18:33
  • 2
    @Fuhrmanator I used http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html and it works for me. – magicandre1981 Apr 23 '14 at 04:09
  • 1
    On 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) – deroby Oct 06 '16 at 13:35
4

How to safely(*) clear disk space on Windows 10(**)

(*) Believed to be safe but no cast-iron guarantee - please only follow at your own risk.

(**) Targeting Windows 10 but similar steps may apply to other versions of Windows.

  1. Download, install and run PatchCleaner to delete orphaned files.
  2. Run Disk Cleanup (e.g. by typing "clean" in the Windows start screen and selecting "Free up disk space by deleting unnecessary files"). Select the drive to be cleaned. Click on "Clean up system files" (and enter credentials if required). Select the drive to be cleaned. Select the option to clear system files.
  3. Open Configuration Manager Properties (e.g. by typing "config" in the Windows start screen and selecting "Configuration Manager"). Select the Cache tab. Click on "Configure Settings" (and enter credentials if required). Click on "Delete Files..." Tick the "Delete persisted cache content" checkbox and click on "Yes".
  4. Download, install and run Treesize Free. Scan the relevant drive and then manually delete any of the larger folders or files that can be deleted (applying the necessary caution).
  5. Open File Explorer and navigate to the Windows temp folder (e.g. C:\Windows\Temp). Select all files and folders and then choose to hard-delete them by pressing SHIFT+DEL (you may be required to enter admin credentials). Then choose to skip all files that cannot be deleted because they are in use.
Steve Chambers
  • 1,032
  • 2
  • 12
  • 23
1

You can try a junction by copying the files to the new drive, then renaming the old installer folder temporarily, creating a junction from the default folder to the new. Then test things for a bit before deleting the renamed installer folder. Maybe install a bigger more complex program like visual studio, or adobe Photoshop, then uninstall it just to make sure all is well. But be forewarned, if anything goes wrong, you might not be able to install or re-install programs. Been there, done that. :)

Damon
  • 1,903
  • 1
  • 14
  • 24
  • https://superuser.com/questions/707767/how-can-i-free-up-drive-space-from-the-windows-installer-folder-without-killing#comment1678197_744812 – ivan_pozdeev Jul 17 '17 at 19:11
  • @ivan_pozdeev a junction is different than a hard link. I use a small program called junction.exe to make it work from https://docs.microsoft.com/en-us/sysinternals/downloads/junction – Damon Oct 12 '17 at 04:41
  • Reciting the comment on the link: _WARNING! This wouldn't work in XP. I once tried and made `C:\Windows\Installer` a junction point, and `msiexec` broke it and recreated the folder anew._ – ivan_pozdeev Oct 12 '17 at 10:01
  • Yes, 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.) – ivan_pozdeev Oct 12 '17 at 10:12
  • 1
    @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! – Damon Oct 12 '17 at 14:51
  • I 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.](https://gist.github.com/native-api/77b7399955195a8ef489e2d3120e5543) That was on XP x64 though -- maybe x32 XP has this bug fixed. Or maybe you were just lucky to have never triggered it. – ivan_pozdeev Oct 12 '17 at 14:56
1

The best solution is to use Windows Installer CleanUp Utility.

https://technet.microsoft.com/en-us/library/2008.08.utilityspotlight.aspx

ivan_pozdeev
  • 1,897
  • 18
  • 34
Hamid
  • 43
  • 2
  • 9
    Welcome 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](http://meta.superuser.com/questions/5329/how-do-i-recommend-software-in-my-answers) on recommending software. – fixer1234 Sep 26 '15 at 23:49
  • 1
    Please 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?](http://meta.superuser.com/q/5329) – bwDraco Sep 27 '15 at 08:09
  • 2
    Thanks @fixer1234 @ DragonLord I will practice the recommended tips next time. – Hamid Sep 28 '15 at 12:53
  • 5
    @hatranpro I would like to suggest practicing the recommended tips on this question by editing it. Now. – SandRock Sep 25 '16 at 12:51
  • 8
    This 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 https://technet.microsoft.com/en-us/library/2008.08.utilityspotlight.aspx . – ivan_pozdeev Jan 06 '17 at 01:19
  • This 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. – chronometric Mar 24 '17 at 19:16
0

I have delete the Installer folder and notice that.

I lost a lot of information's that windows cache there. One it was the icons of the programs links. And many program links left with out an icon.

So I discover that all the directories inside the Installer folder that have a GUID name (like for example {F9013657-4B4D-4F8E-8C57-C2C638F8A65F}) they used for cache of icons.

The size off all that directories are very small - so for me, you have to keep that directories with a GUID as name - and delete the rest.

enter image description here

Aristos
  • 542
  • 7
  • 17