Purpose:Create NTFS symbolic, hard, and soft links

 

Format:MKLINK [/= /A:[[-]rhsadecijopt /A /D /H /J /Q /X] Link Target

 

LinkThe new symbolic link name
TargetThe pathname (full or relative) that the new link refers to

 

/ACreate a link with an absolute path.
/DCreate a directory symbolic link. (The default is to create a file symbolic link.)
/HCreate a hard link (like MKLNK).
/JCreate a junction.
/Q Don't display results.
/X Delete directory link.

 

File Selection

 

Supports command dialog, attribute switches, extended wildcards, ranges, and include lists. Date, time, size, or file exclusion ranges anywhere on the line apply to all source files. Use wildcards with caution on LFN volumes; see LFN File Searches for details.

 

Usage:

 

If you don't specify a target or any options, MKLINK will display information on the link (including OpenAFS reparse points).

 

Due to Windows file system restrictions, creating symbolic links with MKLINK requires an NTFS volume.

 

The file/directory names in Link and Target can be fully or partially qualified. MKLINK will also copy an existing description to the link. If you don't specify any arguments, MKLINK will display its command dialog.

 

MKLINK sets two internal variables:

 

%_mklink_filesThe number of links created
%_mklink_errorsThe number of errors

 

See also MKLNK.

 

Example:

 

Create a symbolic file link "c:\mydir\myfile" that refers to the existing file "c:\data\somefile" :

 

mklink c:\mydir\myfile c:\data\somefile

 

Option:

 

/=Display the MKLINK command dialog to help you set the filename and command line options. The /= option can be anywhere on the line; additional options will set the appropriate fields in the command dialog.

 

/ACreate a link with an absolute (full expanded) pathname. For CMD compatibility, MKLINK creates relative links if you don't specify a full pathname.

 

/DCreate a directory symbolic link. (The default is to create a file symbolic link.)

 

/HCreate a hard link instead of a symbolic link.

 

/JCreate a junction rather than a symbolic link.

 

/QDon't display the result.

 

/XDelete a directory link.