Symlinks or Symbolic Links are symbolic link ( also known as a soft link) consists of a special type of file that serves as a reference to another file or directory. This feature is availble finally in Windows Vista. You can create symlinks using the windows vista command line utility termed as “MKLINK”.
Syntax for Symlink in Vista
MKLINK [ /D] | [/H] | [/J] Link Target
where [] stands for optional and / is used as option
* /D - Create a directory symbolic link ( soft link ). Default is file symbolic link.
* /H - Creates a Hard link ( link to a file ) .
* /J - Creates a directory junction
* LINK - Specifies a new symbolic link name
* Target - Specifies the path that the new link will refer to.
Example of Creating a symbolic link to directory
On command prompt, first navigate to the directory you want. Then ( Here I am at C directory )
* C:\ > mklink /D mySymDir D:\MyBlogData
The above example makes all the data in “C” directory available in D:\Myblogdata. Juts make a Dir in DMyblogdata and You will see all the files of C directory.
Here we will see how we can make data of two directory available in one symlink.
Our Target
Take Directories d:\Blogdata and d:\Images . Now you want to see data of both the directory into a new place say d:\Blog. Now we will use MKLINK /J option to do it. /J stands for directory junction.
Steps to make a junction directory / symlink
* MKLINK /D c:\blog d:\BlogData
* The above steps create a hard link and all data under D:\blogdata directory can be seen in c:\blog.
* Now type MKLINK /J c:\blog d:\images
* Now your d:\images will be added to the symlink you have already create.
* Now when you browse c:\blog you will be able to see both directories data.
source1
source2