2009-04-02

Moving your Windows Installer Directory

I mostly work with Virtual Machines and I like to pre-allocating the disk size. When I created my VM I figured 10GB would be enough for C:\ with Win2003 Server and a couple of SDK's and if I needed more I could always add another drive. I was wrong.

After 2 years my faithful Win2003 dev VM is out of space on C: and I can't shuffle any more files around.

My C:\windows\installer directory is >2GB so this is my prime candidate to move.
Luckily there are always solutions to problems... no I'm not going to delete the directory, or change my registry to point to a new location.

I'm going to add a symbolic link from C:\windows\installer to F:\installer.


  1. Download Junction from http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

  2. Copy OR move C:\windows\installer to F:\installer

  3. Delete all the files in C:\windows\installer

  4. Close all your Explorer windows

  5. Run > cmd> C:\junction C:\WINDOWS\Installer F:\installer
That should do it. I wrote a batch (run.bat) script to do the whole procedure.
@set src=C:\WINDOWS\Installer
@set trg=F:\Installer
::copy %src%\* %trg%
::detele %src%\*
move /y %src%\* %trg%
junction %src% %trg%
pause

This should work for most directories. The batch file should be in the same directory as junction.exe.

23 comments :

  1. Thanks a lot!!! This is a hidden gem!

    ReplyDelete
  2. I've noticed the following post... http://forums.techarena.in/customize-xp/992648.htm . Do you have any comment on that?
    Thanks again!

    ReplyDelete
  3. Giovanni... my understanding was they didn't work well on removable disks.

    Maybe if he enables write caching for the disk it would help... just a guess though.

    MS Installer wouldn't know it's a symbolic link.

    If u have a EEE PC the best performance I've got with SSD is using C: FAT32 for all windows + page file, then D: all programs/profiles.

    ReplyDelete
  4. futu-ti mortii matii de cretin cu tampenia ta cu tot

    ReplyDelete
  5. Thanks a lot too!!! you saved my day, I assigned also 10gb for a windows 2003 c: drive, and I was in trouble now...

    Thanks again!

    ReplyDelete
  6. I try this tip, but it takes the same space in drive C:. Then, there is no more free space on drive C:...

    ReplyDelete
  7. Thank you, this worked beautifully to free up 11Gb of my 64Gb SSD c: drive! On Win7 I also had to delete the c:\windows\installer folder after emptying it

    ReplyDelete
  8. Thanks a lot ! good to know that we can do symlink on windows system.

    ReplyDelete
  9. Thanks :) Been looking for a solution to this. Small SSD disk, and large non-ssd disk on this system with large programs installed was moving towards beeing a problem because of the installer dir.

    ReplyDelete
  10. your sample batch file has delete transposed.

    ReplyDelete
  11. Using this trick which look nice make me lost all the content of my windows installer folder !

    It first look to work well but when you reboot the folder on the new drive is empty and a new empty Installer folder exists on the drive c

    have a look on http://forum.sysinternals.com/problems-with-junction_topic16205.html

    ReplyDelete
  12. @Thierry

    1.- You're copying/moving the contents, so you should always have 1 copy.
    2.- This seems to be a rare issue where the link isn't created properly... possibly because it was been written to.
    3.- If you're new folder is empty, you didn't copy/move the contents, or there's something else wrong.
    4.- You should still be able to recover the lost data with an undelete app.
    5.- This technique works, you must have introduced an new variable.

    Regards, Ray.

    ReplyDelete
  13. Thanks for this. I've had to use it on two of my own and three client servers so far. Dell ships their servers with a default 12GB C:\ and after 3-5 years that fills up quickly.

    I use symlinks all the time in Linux but was unaware until now that this was possible with Windows. Thanks again!

    ReplyDelete
  14. Thanks a lot! this is brillaint

    ReplyDelete
  15. Attractive, post. I just stumbled upon your weblog and wanted to say that I have liked browsing your blog posts. After all, I will surely subscribe to your feed, and I hope you will write again soon! senior movers

    ReplyDelete
  16. Boxes. Moving boxes can be single divider, for example, Book boxes, Linen boxes and so forth or twofold divider, for example, China Boxes, Bayside Mowing

    ReplyDelete
  17. Intrigued Internet guests will actually want to peruse the different classifications in the directory and find sites like yours that they might keen on visit. Basically, https://onohosting.com/

    ReplyDelete
  18. Thanks for sharing! I know this is out of the content but I just want to share Accountant in Sydney . https://malkounassociates.com.au/

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. Revel in the relaxation of the 12 months. You are doing a powerful job. 먹튀폴리스

    ReplyDelete