Moving your Windows Installer Directory

25 May

Moving the C:\WINDOWS\INSTALLER Directory

Often servers or workstations will run low of disk space on the system partition.  This is especially true I’ve found with older Dell servers that shipped with a 12GB system partition.

The c:\windows\installer directory often occupies several gigabytes of storage.

While Windows does not provide a mechanism to re-point this directory via the registry, you can use NTFS junctions/reparse points to re-point the directory to a different local volume.  Re-pointing to UNC paths is not supported.

  1. Obtain junction.exe fromhttp://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

    I found it handy to add the executable to c:\windows\system32 for easy access

  2. Create the destination Installer folder on the new volume (ie: D:\Installer)
  3. Move all content from c:\windows\installer to your new directory
  4. Make sure to close any explorer windows with these folders opened.  Junction.exe requires that there are no open file handles to these directories
  5. Create the junction

    junction.exe c:\windows\installer d:\installer

Posted by Steven Berkovitz at 12:42 PM  

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.

at 12:26