Windows创建符号连接

1、mklink
该命令可以创建符号链接、硬链接及快捷方式。

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    specifies the new symbolic link name.
        Target  specifies the path (relative or absolute) that the new link
                refers to.

2、fsutil hardlink
该命令可以创建硬链接。

create          Create a hardlink
list            Enumerate hardlinks on a file

3、junction
该工具是SYSINTERNALS提供的,可以新增或删除符号链接。

The first usage is for displaying reparse point information, the
second usage is for creating a junction point, and the last for
deleting a junction point:
usage: junction.exe [-s] [-q] <file or directory>
       -q     Don't print error messages (quiet)
       -s     Recurse subdirectories

usage: junction.exe <junction directory> <junction target>
       example: junction d:\link c:\windows

usage: junction.exe -d <junction directory>

Comments are closed.