[Reprinted] detailed explanation of Windows 7 mklink command

Source: Internet
Author: User
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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.