Windows 7 – Moving Folders with Junction Links (mklink)

junctionmklinkwindows 7

Space on my SSD is running pretty low, and there seems to be a 19GB folder in Windows that sticks out (%windir%\Installer) and cannot be safely deleted (as explained here: https://serverfault.com/q/15746).

Now, the mklink provides a neat little thing called Junction links – if I boot in cmd prompt, and move all of the files to the other hard drive, and then run this:

mklink /J C:\Windows\Installer D:\Windows\Installer

Will I be messing up my Windows in some way, or is this an OK thing to do? Will folder permissions/attributes stay the same across the link?

I've used hard links before, and it worked like a charm freeing up my SSD significantly, but I've never tried it on system folders (I don't see why it wouldn't work, but I'm not in the mood of reinstalling entire windows in case I'm wrong)

Best Answer

OK, I've taken the risk and it was worth it - everything works normally, but I have freed the 17GB on my SSD now.

Basically, the steps are:

  1. Restart your PC, press F8 continuously to bring up boot menu, and choose "Command prompt with safe mode" (this is to ensure you can move the windows folder around)
  2. Once the command prompt is shown, type the command to move the folder to another drive:
    robocopy C:\Windows\Installer D:\Windows\Installer /MOVE /e
  3. Next, create a "Junction" link for the missing folder:
    mklink /J C:\Windows\Installer D:\Windows\Installer

Of course, this assumes that your %WINDIR% is C:\Windows, that your D drive is the one with more space, that you want your destination in "D:\Windows\Installer" (it could be any folder, just be consistent) etc...

This should do the trick.

Related Question