The mklink command in Windows 7 can establish different forms of file or directory links by specifying parameters, including hard link, symbolic link, and soft link (directory connection) (junction.
1. Symbolic Link is equivalent to a shortcut
Creating a soft link is equivalent to creating a file (or directory). This file (or directory) is used to point to another file (or directory), which is similar to win's shortcut. Deleting this link does not affect the image of the original file (or directory). When you delete the original file (or directory, when the link is opened, the system prompts "the location is unavailable ".
2. Soft link (directory connection) (junction) Source Path change will not become invalid
The function is similar to the symbolic link. The difference is that when a soft link is created, the absolute path of the original file (or directory) is automatically referenced, and the symbolic link allows reference of the relative path.
3. Hard Link)
Creating a hard link is equivalent to creating an alias for the file, for example, 1. TXT is created with the name 2. TXT hard link, if you use NotePad to 1. 2. TXT is also modified. If 1.txtis deleted, 2. TXT still exists, and the content matches 1. same as TXT.
Note the following before creating a link:
1. The creation of file or directory links is limited to the NTFS file system. The establishment of symbolic (soft) links can be cross-file systems;
2. Hard links can only be used for files, not for directories, and symbolic (soft) links can be used to create links for directories;
3. Hard links can only point to files in the same partition;
4. Hard links do not allow empty files to be linked. You can use a symbolic (soft) link.
Mklink Parameter Definition
No parameter specified: Create a symbolic link to the file. If no parameter is specified, a symbolic link is created by default. Deleting a linked file does not affect the source file,
/D: Create a symbolic link (symbolic link) for the directory)
/J: create a directory soft link (directory connection) (junction)
/H: hard link)
Command Format: mklink/d (definition parameter) \ MyDocs (link file) \ Users \ User1 \ Documents ents (original file)
Finally, use the "DEL" command like deleting an object to delete the established link.
For win2k3: mklink is not required. More common linkd