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

966,491

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

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.

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.

  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

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.

Share:
966,491

Related videos on Youtube

DeepSpace101
Author by

DeepSpace101

Updated on September 18, 2022

Comments

  • DeepSpace101
    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
      Fuhrmanator about 10 years
      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.
    • HopelessN00b
      HopelessN00b about 10 years
      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.
    • Jay Imerman
      Jay Imerman over 8 years
      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.
    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 about 8 years
      Related/Duplicate from 2009, still relevant: Is it safe to delete from C:\Windows\Installer?
    • Peter VARGA
      Peter VARGA almost 7 years
      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!
    • mcy
      mcy over 6 years
      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.
    • Rosdi
      Rosdi about 6 years
      The easiest would be to compress the folders as described by Hans below.
    • oliver
      oliver over 5 years
      Too 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
      Vadzim about 4 years
  • Fuhrmanator
    Fuhrmanator about 10 years
    I'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
    magicandre1981 about 10 years
    @Fuhrmanator I used schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html and it works for me.
  • Mladen B.
    Mladen B. over 9 years
    Wouldn't it be better if you first moved "C:\Windows\Installer" to "D:\C_DRIVE\Windows\Installer" and then ran mklink?
  • Fuhrmanator
    Fuhrmanator about 9 years
    @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.
  • user3773503
    user3773503 about 9 years
    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.
  • Fuhrmanator
    Fuhrmanator about 9 years
    There'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
    fluxtendu about 9 years
    The move option crash PatchCleaner on my side. (don't want to try delete)
  • jcrawfor74
    jcrawfor74 almost 9 years
    Bugger. I understand not wanting to use the delete function :-).
  • jcrawfor74
    jcrawfor74 almost 9 years
    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.
  • George Dima
    George Dima almost 9 years
    thanks, worked perfect, reduced the size from 10GB to 3GB on my install. other tools failed
  • user3382103
    user3382103 almost 9 years
    How does it know if a file is orphaned or not?
  • jcrawfor74
    jcrawfor74 almost 9 years
    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.
  • JqueryToAddNumbers
    JqueryToAddNumbers almost 9 years
    best method that is perfectly safe. it reduced my folder by 2gb from 12gb
  • Simon D
    Simon D almost 9 years
    Saved 10GB, about 10% of my disk. Thanks
  • Alexander Popov
    Alexander Popov almost 9 years
    Great tool, really liked it, works seamlessly :)
  • hedgepig
    hedgepig almost 9 years
    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 :)
  • Ev0oD
    Ev0oD almost 9 years
    Is there some likelihood that after making this operation, the upcoming upgrade to windows 10 will fail due to this modification?
  • Fuhrmanator
    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
    nietras almost 9 years
    Thanks, I had 29GB in this directory and it was reduced to 10GB.
  • zukanta
    zukanta over 8 years
    Just saved up 17 gigs on a chocking SSD. Beautiful tool, thanks!
  • chronometric
    chronometric over 8 years
    Nice one, I install almost entirely from physical installers, so this was a good 5gb out of my problem! Thanks x3
  • fixer1234
    fixer1234 over 8 years
    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.
  • bwDraco
    bwDraco over 8 years
    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?
  • hatranpro
    hatranpro over 8 years
    Thanks @fixer1234 @ DragonLord I will practice the recommended tips next time.
  • RedX
    RedX over 8 years
    Do you think it would be possible to create a portable version of this tool?
  • Mian Asbat Ahmad
    Mian Asbat Ahmad over 8 years
    To view C:\Windows\Installer folder, uncheck the Hide protected operating system files option in the folder options.
  • Terry
    Terry over 8 years
    Nice looking little piece of software too, +1 for simple interface
  • Syaiful Nizam Yahya
    Syaiful Nizam Yahya about 8 years
    Used this method on my Windows 10. So far so good.
  • Ben Johnson
    Ben Johnson about 8 years
    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.
  • Adam Colbert
    Adam Colbert almost 8 years
    Awesome! 20 GB freed out of nowhere! I moved them to an external hard drive in case I need them. Thanks a lot! :)
  • zrisher
    zrisher almost 8 years
    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?
  • trapicki
    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
    Flion almost 8 years
    yup perfect, took a while to start up though (or I didnt see the screen anywhere). But cleared up a lot of space!
  • SandRock
    SandRock over 7 years
    @hatranpro I would like to suggest practicing the recommended tips on this question by editing it. Now.
  • deroby
    deroby over 7 years
    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)
  • bastijn
    bastijn over 7 years
    Or just browse directly to it and right-click in the empty space.
  • Dunc
    Dunc over 7 years
    Safer 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
    ysap over 7 years
    This method is not really useful for a laptop, or a single disk desktop, right?
  • Fuhrmanator
    Fuhrmanator over 7 years
    @ysap if there is space on another partition of the SSD, it's useful.
  • Andrea
    Andrea over 7 years
    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)
  • ivan_pozdeev
    ivan_pozdeev over 7 years
    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
    ivan_pozdeev over 7 years
    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 technet.microsoft.com/en-us/library/… .
  • ivan_pozdeev
    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
    Evgeny Gorb over 7 years
    I executed WICleanup tool after Patch Cleaner and it found more unused files (Patch Cleaner found 22+ Gb and WICleanup 5+ Gb more)
  • magicandre1981
    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
    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
    Evgeny Gorb over 7 years
    @magicandre1981: Thank for the reply. It's good that I just scanned for the files without removing them)
  • saintali
    saintali over 7 years
    That's COMPACT /C /S:C:\Windows\Installer.
  • chronometric
    chronometric about 7 years
    @RedX There is a portable version available on the project's SourceForge page: sourceforge.net/projects/patchcleaner/files/…
  • chronometric
    chronometric about 7 years
    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.
  • Gravity
    Gravity about 7 years
    note: this programrequired .net!
  • user30747
    user30747 almost 7 years
    Recovered 30.44 GB. Thanks for the tool! Would be nice if it was libre software; it would have eased the trust question ;)
  • ivan_pozdeev
    ivan_pozdeev almost 7 years
  • Sergei Gorbikov
    Sergei Gorbikov almost 7 years
    was unable to access the URL (This site can’t be reached) on 26 Aug 2017
  • Damon
    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
    ivan_pozdeev over 6 years
    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
    ivan_pozdeev over 6 years
    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.)
  • Damon
    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
    ivan_pozdeev over 6 years
    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.
  • divenex
    divenex over 6 years
    Freed 24 GB of junk in my Windows 10 folder and everything works perfectly. Many thanks!
  • vanessa
    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
    Rosdi about 6 years
    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!!
  • John Alexiou
    John Alexiou almost 6 years
    You can check if there is an install running by looking for a msiexec process running.
  • A Khudairy
    A Khudairy over 5 years
    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.
  • IvanH
    IvanH over 5 years
    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
  • Erik Johnson
    Erik Johnson over 5 years
    For me, that's 32GB of the 37GB in the Installer directory. Good pointer.
  • Shady Mohamed Sherif
    Shady Mohamed Sherif about 5 years
    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
  • treckstar
    treckstar about 5 years
    This should definitely be the selected answer, as it provides a very safe solution to the question asked.
  • Amessihel
    Amessihel over 4 years
    Thanks, although this way is bothering: it's like moving dust instead of cleaning it. :-/
  • Teejay
    Teejay almost 4 years
    Thanks, at least I freed up 2.5 GB of about 20.
  • z2z
    z2z over 3 years
    Great tool, must have for windows users.
  • mrmut
    mrmut over 3 years
    May the blessings and good grace of good of IT be upon you!
  • Ravindra Bawane
    Ravindra Bawane about 3 years
    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.
  • spikey_richie
    spikey_richie almost 3 years
    Just used it to good effect, reducing a 60.9GB folder down to 7.7GB
  • mrmut
    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
    user1696603 about 2 years
    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$".