Creates a symbolic link.

For examples of how to use this command, see Examples.


mklink [[/d] | [/h] | [/j]] <Link> <Target>


Parameter Description
/d Creates a directory symbolic link. By default, mklink creates a file symbolic link.
/h Creates a hard link instead of a symbolic link.
/j Creates a Directory Junction.
<Link> Specifies the name of the symbolic link that is being created.
<Target> Specifies the path (relative or absolute) that the new symbolic link refers to.
/? Displays help at the command prompt.


The following example demonstrates the creation and removal of a symbolic link named MyFolder and MyFile.file from the root directory to the \Users\User1\Documents directory and a example.file located within the directory:

mklink /d \MyFolder \Users\User1\Documents
mklink /h \MyFile.file \User1\Documents\example.file
rd \MyFolder
del \MyFile.file

Additional references