How can I free up drive space from the Windows installer folder without killing Windows?

395

154

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

Posted 2014-01-27T17:55:45.683

Reputation: 7 579

2Are 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 – 2015-11-06T15:13:40.180

Related/Duplicate from 2009, still relevant: Is it safe to delete from C:\Windows\Installer?

– Ƭᴇcʜιᴇ007 – 2016-03-09T04:16:55.530

3You 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! – Al Bundy – 2017-08-10T09:03:55.660

2It 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 – 2017-12-11T13:18:38.830

The easiest would be to compress the folders as described by Hans below. – Rosdi – 2018-03-17T16:53:08.170

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 – 2018-11-29T19:22:21.253

2I 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 – 2014-04-22T21:02:20.437

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 – 2014-04-22T22:00:56.990

Answers

217

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

Posted 2014-01-27T17:55:45.683

Reputation: 2 712

5Wouldn't it be better if you first moved "C:\Windows\Installer" to "D:\C_DRIVE\Windows\Installer" and then ran mklink? – Mladen B. – 2015-02-24T11:02:59.670

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 – 2015-05-10T11:39:48.943

3It'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 – 2015-05-18T09:07:30.460

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 – 2015-05-21T20:20:24.263

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 – 2015-07-17T18:12:24.860

Is there some likelihood that after making this operation, the upcoming upgrade to windows 10 will fail due to this modification? – Ev0oD – 2015-07-27T15:41:51.540

@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 – 2015-08-04T19:19:29.997

Used this method on my Windows 10. So far so good. – Syaiful Nizam Yahya – 2016-03-22T15:06:00.397

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 – 2016-07-20T21:35:30.843

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 – 2016-07-22T07:40:21.977

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 – 2016-10-19T09:30:45.170

This method is not really useful for a laptop, or a single disk desktop, right? – ysap – 2016-11-05T12:12:31.583

@ysap if there is space on another partition of the SSD, it's useful. – Fuhrmanator – 2016-11-05T12:26:17.870

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 – 2017-01-05T21:55:09.470

You can check if there is an install running by looking for a msiexec process running. – ja72 – 2018-06-21T15:02:24.323

Thanks, although this way is bothering: it's like moving dust instead of cleaning it. :-/ – Amessihel – 2020-01-23T15:51:59.237

212

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

Posted 2014-01-27T17:55:45.683

Reputation: 2 547

The move option crash PatchCleaner on my side. (don't want to try delete) – fluxtendu – 2015-05-30T16:14:45.287

Bugger. I understand not wanting to use the delete function :-). – jcrawfor74 – 2015-06-01T12:16:25.327

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 – 2015-06-01T12:28:36.470

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 – 2015-06-02T10:46:26.173

thanks, worked perfect, reduced the size from 10GB to 3GB on my install. other tools failed – George Dima – 2015-06-04T17:21:08.070

How does it know if a file is orphaned or not? – Kevin Doyon – 2015-06-10T19:40:56.317

3Magic :-). 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 – 2015-06-12T10:13:56.543

Saved 10GB, about 10% of my disk. Thanks – Simon D – 2015-06-16T17:09:16.863

13Great tool, really liked it, works seamlessly :) – Alex Popov – 2015-07-15T08:35:29.460

Thanks, I had 29GB in this directory and it was reduced to 10GB. – nietras – 2015-08-19T09:45:46.737

Just saved up 17 gigs on a chocking SSD. Beautiful tool, thanks! – zukanta – 2015-09-11T17:07:25.023

12Do you think it would be possible to create a portable version of this tool? – RedX – 2015-12-09T07:59:31.503

Nice looking little piece of software too, +1 for simple interface – Terry – 2016-02-02T13:57:03.840

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 – 2016-05-04T20:16:48.910

Awesome! 20 GB freed out of nowhere! I moved them to an external hard drive in case I need them. Thanks a lot! :) – Kounavi – 2016-06-01T21:16:31.523

yup perfect, took a while to start up though (or I didnt see the screen anywhere). But cleared up a lot of space! – Flion – 2016-08-06T12:12:11.510

@jcrawfor74 what about patches that are referenced in registry but don't belong to any installed product? Are they "orphaned", too? – ivan_pozdeev – 2017-01-06T09:26:04.167

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 – 2017-01-10T12:13:05.360

@EvgenyGorb congrates for damaging Windows. WICleanup is 32bit and only works fine in 32bit Windows, all 64bit MSI files are threaten as removable. – magicandre1981 – 2017-02-04T09:18:06.463

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 – 2017-02-04T09:19:00.033

@magicandre1981: Thank for the reply. It's good that I just scanned for the files without removing them) – Evgeny Gorb – 2017-02-06T09:49:42.847

1

@RedX There is a portable version available on the project's SourceForge page: https://sourceforge.net/projects/patchcleaner/files/PatchCleaner_Portable/

– chronometric – 2017-03-24T18:45:17.403

note: this programrequired .net! – Ultralisk – 2017-03-31T08:44:31.553

5Recovered 30.44 GB. Thanks for the tool! Would be nice if it was libre software; it would have eased the trust question ;) – user30747 – 2017-07-17T19:10:13.973

was unable to access the URL (This site can’t be reached) on 26 Aug 2017 – Sergei Gorbikov – 2017-08-26T18:34:42.283

Freed 24 GB of junk in my Windows 10 folder and everything works perfectly. Many thanks! – divenex – 2017-10-19T15:17:14.070

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 – 2018-02-23T20:48:14.603

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 – 2018-10-22T10:50:54.210

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

– IvanH – 2019-01-04T08:35:38.420

1why 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 Sherif – 2019-03-16T12:46:17.017

This should definitely be the selected answer, as it provides a very safe solution to the question asked. – Brandon Trecki – 2019-03-16T18:38:41.047

83

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

Posted 2014-01-27T17:55:45.683

Reputation: 841

7best method that is perfectly safe. it reduced my folder by 2gb from 12gb – JqueryToAddNumbers – 2015-06-14T06:14:15.593

4To view C:\Windows\Installer folder, uncheck the Hide protected operating system files option in the folder options. – Mian Asbat Ahmad – 2015-12-21T12:54:21.863

5Or just browse directly to it and right-click in the empty space. – bastijn – 2016-10-17T12:43:31.933

I 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) – Andrea – 2016-12-28T12:00:20.240

16That's COMPACT /C /S:C:\Windows\Installer. – saintali – 2017-02-07T21:40:56.767

I went beserk, I compressed the entire c:\Windows folder, Program Files, and Users folder. My free space went up from 3Gb to 17Gb... woot!! – Rosdi – 2018-03-17T16:48:56.423

12

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

Max

Posted 2014-01-27T17:55:45.683

Reputation: 278

1Nice one, I install almost entirely from physical installers, so this was a good 5gb out of my problem! Thanks x3 – chronometric – 2015-09-25T14:36:50.123

1For me, that's 32GB of the 37GB in the Installer directory. Good pointer. – Erik Johnson – 2019-02-26T00:02:35.133

7

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

magicandre1981

Posted 2014-01-27T17:55:45.683

Reputation: 86 560

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 – 2016-10-06T13:35:26.727

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 – 2014-04-22T18:33:37.647

1

@Fuhrmanator I used http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html and it works for me.

– magicandre1981 – 2014-04-23T04:09:08.203

2

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

(*) The following steps are generally believed to be safe but I offer no cast-iron guarantees so please use at your own risk.

(**) The instructions were written for Windows 10 but similar instructions may also apply to other versions of Windows.

  1. 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 and install Treesize Free. Run it, 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

Posted 2014-01-27T17:55:45.683

Reputation: 618

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

Posted 2014-01-27T17:55:45.683

Reputation: 1 789

@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 – 2017-10-12T04:41:49.057

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 – 2017-10-12T10:01:06.647

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 – 2017-10-12T10:12:41.687

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 – 2017-10-12T14:51:09.557

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. 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 – 2017-10-12T14:56:23.213

1

The best solution is to use Windows Installer CleanUp Utility.

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

hatranpro

Posted 2014-01-27T17:55:45.683

Reputation: 35

8

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 on recommending software.

– fixer1234 – 2015-09-26T23:49:32.493

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?

– bwDraco – 2015-09-27T08:09:26.487

2Thanks @fixer1234 @ DragonLord I will practice the recommended tips next time. – hatranpro – 2015-09-28T12:53:16.157

4@hatranpro I would like to suggest practicing the recommended tips on this question by editing it. Now. – SandRock – 2016-09-25T12:51:13.890

4

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 – 2017-01-06T01:19:32.500

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 – 2017-03-24T19:16:22.293