mklink
mklink is a command-line utility in Windows that creates reparse points in NTFS volumes, enabling symbolic links, hard links, and directory junctions. It is invoked from the Command Prompt and supports several link types to redirect a link name to a specified target.
- mklink Link Target creates a symbolic link to a file named Link that points to Target. This
- mklink /D Link Target creates a directory symbolic link.
- mklink /H Link Target creates a hard link to a file. Hard links must refer to a
- mklink /J Link Target creates a directory junction, a type of reparse point that links to an
- Symbolic links can point to files or directories across volumes and can reference UNC paths; hard
- Link creation generally requires appropriate privileges: on some Windows versions, administrative rights are needed, while enabling
- Deleting the link does not delete the target; only the link itself is removed.
- The Link name must not already exist. The Target may or may not exist depending on the
- mklink MyLink.txt Target.txt
- mklink /D MyFolder TargetFolder
- mklink /H MyFileLink.txt Target.txt
- mklink /J MyFolderLink TargetFolder
mklink is commonly used to create convenient aliases for files and directories, redirect software paths, or