Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

  1. Isn't a directory junction the exact same thing as a directory symbolic link?

    What's the difference between mklink /D f1 f2 and mklink /J f1 f2 ?

  2. Since a "directory" is actually just a file, what would be the difference between a directory symbolic link and a file symbolic link?

share|improve this question
Related: – surfasb Dec 29 '11 at 13:05

2 Answers 2

up vote 154 down vote accepted

A junction is definitely not the same thing as a directory symbolic link, although they behave similarly. The main difference is that, if you are looking at a remote server, junctions are processed at the server and directory symbolic links are processed at the client. Also see Matthew's comment on the fact that this means symbolic links on the local filesystem can point to remote filesystems.

Suppose that on a machine named Alice you were to put a junction point c:\myjp and a directory symbolic link c:\mysymlink, both pointing to c:\targetfolder. While you're using Alice you won't notice much difference between them. But if you're using another machine named Bob, then

\\Alice\c$\myjp -> \\Alice\c$\targetfolder


\\Alice\c$\mysymlink -> \\Bob\c$\targetfolder.

(Caveat: by default, the system doesn't follow symlinks on remote volumes, so in most cases the second example will actually result in either "File Not Found" or "The symbolic link cannot be followed because its type is disabled.")

The difference between a directory symbolic link and a file symbolic link is simply that one represents a directory and one represents a file. Since the target of the link doesn't need to exist when the link is created, the file system needs to know whether to tell applications that it is a directory or not.

It should also be noted that creating a symbolic link requires special privilege (by default, only available to elevated processes) whereas creating a junction only requires access to the file system.

share|improve this answer
Just to be clear: there may well be other subtler functional differences between directory junctions and directory symbolic links. The remote vs. local thing is just the most obvious from a user (as opposed to a developer) perspective. – Harry Johnston Oct 5 '11 at 4:02
@MatthewSteeples do you mean that if I create a symbolic link C:\testlink (which points to C:\test on my computer) and someone remote access my computer and clicks on C:\testlink, it would resolve to the C:\test on HIS computer, Whereas if I create a directory junction C:\testlink (which points to C:\test on my computer), and someone remote access my computer and clicks on C:\testlink) it would lead him to the C:\test on my computer? Or did I get it the wrong way round? – Pacerier Oct 5 '11 at 8:19
@Pacerier in this context yes, but symbolic links allow you to have a folder on your computer that points to a network share (because they're resolved client side). Eg C:\MyNetworkShare could actually point to \\Alice\Share – Matthew Steeples Oct 6 '11 at 14:57
@MatthewSteeples but couldn't we create a directory junction C:\MyNetworkShare which points to \\Alice\Share as well? – Pacerier Oct 7 '11 at 10:44
@Pacerier, no, junction points have to be local. – Harry Johnston Oct 8 '11 at 0:05

Complex talk hurts brain -- I like charts:

Assume any MyLink is a symbolic link and any MyJunc is a junction pointing at Target as created.

e.g.mklink /D C:\MyLink C:\MyDir for the first row

What you type |Target as created| What's delivered  | What you wanted
  (local)     |    (local)      |    (local)        |    (local)
C:\MyLink     |  C:\MyDir       |  C:\MyDir         |  C:\MyDir
C:\MyJunc     |  C:\MyDir       |  C:\MyDir         |  C:\MyDir
              |                 |                   |
  (remote)    |    (local)      |   (error/local)   |    (remote)
\\Svr\MyLink  |  C:\MyDir       |  ERROR(C:\MyDir)  |  \\Svr\C\MyDir
  (remote)    |    (local)      |    (remote)       |    (remote)
\\Svr\MyJunc  |  C:\MyDir       |  \\Svr\C\MyDirr   |  \\Svr\C\MyDir
              |                 |                   |
  (local)     |    (remote)     |    (remote)       |    (remote)
C:\MyLink     |  \\Sv2\MyDir    |  \\Sv2\MyDir      |  \\Sv2\MyDir
  (local)     |    (remote)     |    (impossible)
C:\MyJunc     |  \\Sv2\MyDir    |  *** Can't be done - Must point local ***
              |                 |                   |
  (remote)    |    (remote)     |    (maybe?)       |    (remote)
\\Svr\MyLink  |  \\Sv2\MyDir    |  Error*1          |  \\Sv2\MyDir
  (remote)    |    (remote)     |    (impossible)
\\Svr\MyJunc  |  \\Sv2\MyDir    |  *** Can't be done - Must point local ***

Error*1 - actually, if you unblocked access to remote symbolic links, then this would work ... I think
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.