Create a symlink in Windows
Even if NTFS was under Windows 2000, made the symbolic links in directory (also known as directory junctions), it was not until the release of Windows Vista to finally have the ability to create symbolic links to files ( also known as soft link under Linux).
A directory junction allows you to create a directory that points to a different directory. Thus, it is possible to select the directory C: \ sys32 to C: \ Windows \ system32. The advantage is to have a shorter way to go to your directory.
It is also interesting to know that Windows manages symlinks locally, ie a link to a file on a remote server will be considered local. In this case, your symlink may well point to a file server remotely. Interesting, no?
To create a symlink in Windows Vista, it is first necessary to open a command prompt by being logged on as an administrator.
- Go to the Start menu and type cmd in the search fields.
- Once the file cmd.exe is found, click the right mouse button and choose Run as administrator.
Once in the command prompt, create a symbolic link is realized with the mklink.
The syntax of the command and its available options.
MKLINK [[/ D] | [/ H] | [/ J]] Link Target
- / D: Create a symlink to a directory. By default, this is a symlink to a file.
- / H: Create a real link instead of a symlink.
- / J Creates a Directory Junction.
- Link:Specifies the name of the new symbolic link.
- Target:Specifies the path (relative or absolute) to which the new link refers to.
Creating a symbolic link will then simply For example:
mklink cmd \ Windows \ system32 \ cmd.exe
http://gallery.techarena.in/data/519/thumbs/SYMLINK.png
If we want to create such a link C: \ sys32 pointing to C: \ Windows \ system32, we simply create a link directory as follows:
mklink / d C: \ sys32 C: \ Windows \ system32
http://gallery.techarena.in/data/519...s/Junction.png
When you list a directory with the DIR command at a command prompt, symbolic links will be marked with the target <SYMLINK> indicated in brackets.
http://gallery.techarena.in/data/519...YMLINK-dir.png
Similarly, directory junctions will be marked as <JONCTION>.
http://gallery.techarena.in/data/519...NCTION-dir.png
As for their display in Windows Explorer, the icons will be displayed with the shortcut arrow.
Re: Create a symlink in Windows
Note: Adding symlinks in Windows Vista has resulted in the modification of certain system commands. So if you want to delete a symbolic link, the Delete command does not follow the link (which destroy the target by pointing the link!) But simply remove the link itself.
It is strongly recommended that you back up the registry, the system and your data before using this trick. TechArena.IN can not be held liable for any damage as a result of using this trick.
Caution: If the Delete command knows the difference between a symbolic link with a real file or directory, it is not necessarily the case for all applications! Attention the false manipulation!