How To Create Symlinks in Windows

Creating symlinks in Linux has always been an easy and useful tool. Almost every web application I’ve ever created with a deployment script uses symlinks in some manner to either link to the proper config files, or link to some directory that doesn’t belong in the version control that I’m deploying from.

I believe since the launch of Vista, Windows has included the ability to symbolically link to files and folders. I recently had to duplicate the functionality of a linux environment and had to do as follows. Create a folder named ‘testlink’ under the C drive. Open up the Windows Command Prompt and enter the following:

C:\testlink> mklink /D C:\testlink2 C:\testlink

Now, if you go open up Windows explorer, you’ll see 2 directories. The first, being your original folder called ‘testlink’, the second your newly created symlink folder called ‘testlink2’. You can see the icon that signifies that this folder is a symlink.

So, to create the link, ‘mklink /D C:\newsymbolicfolder C:\existingfolder’

Posted by Will on June 26, 2012

Leave a Reply

Your email address will not be published. Required fields are marked *

TechJunkie Also Recommends