Symbolic links, also known as soft links, are special types of files that point to another file or folder in your operating system. Essentially you can think of them as advanced shortcuts. They can come in handy for a variety of different tasks. I frequently use them when I need to sync something to Dropbox but don't want to place the file directly into my Dropbox folder. To create a soft link we will use the MKLINK command and run it from the Command Prompt (CMD) in administrator mode. The basic MKLINK command syntax is as follows.
MKLINK [flag] Link-Location Original-File-Location
Additionally, there are a few optional flags which you can pass the commnad...
/D --- Directory Soft Link
If you want to link a folder/directory instead of an individual file then you will need to use the /D flag
/H ---Hard Link Instead of Soft Link (Files)
Hard links are a little different than soft links. Instead of acting as a shortcut to a file, they act as the file its self. Essentially, your operating system creates another reference to where the file is stored in memory. Thus if the original target reference gets deleted you can still access the data, where as if you used a soft link and the target was deleted then your soft link would fail.
/J ---- Directory Junction (Folders)
This is essentially the same as the /H flag except that the /J option should be used when linking folders instead of files.
Examples.....
Soft Link of a file
MKLINK C:\NewSoftLinkFile.txt C:\subfolder\TargetFile.txt
Soft Link of a folder
MKLINK /D C:\SoftLinkFolder C:\subfolder\TargetFolder
Hard Link of a file
MKLINK /H C:\NewHardLinkFile.txt C:\subfolder\TargetFile.txt
Hard Link of a folder
MKLINK /J C:\NewHardLinkFolder C:\subfolder\TargetFolder
--
Posted By Conrad Sykes to
The Computer Kid at 8/05/2013 07:55:00 PM