Symbolic links on Windows

Many years ago, (many years, many years ago...), when I installed Windows 2000 on gold, my first hand-built PC, I created a C:\ partition of 2GB in size. I thought this would be plenty large enough for the basic Windows files etc. Wrong again.

After a few years I was down to a hundred MBs of free space, even after moving swap space and browser cache to the second drive. There's just so much stuff that has to be installed under C:\. I seemed to spend all my time just trying to sweep away junk in C:\. On UNIX I could have solved this easily by shifting one of the directories to another file system and using symbolic links. But on Windows...

All was not lost. There is an equivalent of ln -s under windows, using an NTFS feature called junction points. Unfortunately (but typically), there is no way of accessing this in a standard Windows 2000 install, as the key utility, linkd, is on the Windows 2000 Resource Kit. However, by a lucky chance I had the Windows 2000 Resource Kit.

So, booting into safe mode, I copied the entire contents of C:\Program Files to the D:\ drive as CProgramFiles. I then renamed C:\Program Files and created a junction point using linkd:

  linkd C:\Program Files D:\CProgramFiles

I checked that the junction point had been created, also using linkd:

  C:\> linkd "Program Files"
  Source  Program Files is linked to

I rebooted into normal mode and everything seemed fine. Now the acid test: I deleted the saved contents of Program Files on C:\. Windows warned me about some files, but in the end the directory was gone. One more re-boot and... yes, everything still works and I have 750MB of free space on C:\.

You can still make use of junction point capabilities without access to the Windows 2000 Resource Kit. Junction, written by Mark Russinovich of SysInternals, is a free command line utility for creating directory symbolic links on NTFS 5 filesystems.