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 available finally in Windows Vista and now in Windows 7.
Syntax for Symlink in Vista / Windows 7
You can create symlinks using the command line utility termed as “MKLINK”.
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 D:\Myblogdata and You will see all the files of C directory.
If you are not comfortable using command line, there are couple of software which you can use to create.
It is a smart GUI application which allows you to create symbolic links easily with options of Copying content, deleting original directory and overwriting confirmation.
The advantage of using Symbolic links is that they are transparent to users; the links appear as normal files or directories, and can be acted upon by the user or application in exactly the same way. Since they are native to NTFS file system, Windows XP users don’t have option to create Symbolic Links for technical reason. Works for Windows 7 and Vista. Download Directory Linker @ codeplex
Symbolic Link Creator
We talked about creating symbolic link creator using Directory Linker and here is another tool which is much advanced and just lacks one feature over Directory linker.
- Create File or Folder Symbolic links
- Supports Directory Junction creation along with symlinks and hardlinks.
- Portable Application.
Download it from here.
However with default option you will be able to see only one directory or folder data in the symlink created. Here we will see how we can make data of two directory available in one symlink.
How to make data of two folders available in one
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.
Now if you have Windows 7 I will suggest you to use the library feature instead.