"directory junction" vs "directory symbolic link"?

Solution 1:

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 file system can point to remote file systems.

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 the junction point

\\Alice\c$\myjp will point to \\Alice\c$\targetfolder

but the symbolic link

\\Alice\c$\mysymlink will point to \\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.

Solution 2:

Symbolic links have more functionality, while junctions almost seem to be a legacy feature because of their limitations, but the security implications of these limitations are specifically why a junction might be preferred over a symbolic link. Remote targeting makes symbolic links more functional, but also raises their security profile, while junctions might be considered safer because they are constrained to local paths. So, if you want a local link and can live with an absolute path, you're probably better off with a junction; otherwise, consider a symbolic link for its added abilities.

enter image description here

**The statement of difference in speed/complexity comes from an unverified statement in the Wikipedia entry on NTFS reparse points (a good read).*


Other NTFS Link Comparisons

Here are some other comparisons on the topic, but these can be misleading when considering junctions because they don't list the benefits I list above.

Taken from here (a good introductory read)

enter image description here

From SS64 page on MKLink

enter image description here


Comments about Terminology

Junctions are Symbolic Links

Junctions and Symbolic links are really doing the same thing in the same way (reparse points), aside from the aforementioned differences in how they're processed. In fact, technically, a Junction is a symbolic link, and sometimes documentation might call a Junction a symbolic link, as is the case here. So, that's just something to be aware of regarding terminology.

NTFS

Even though the OP specifies this, it's worth pointing out that "symbolic link" is a very general term that is not specific to NTFS. So, to be specific, this comparison is about NTFS Junctions vs. NTFS Symbolic Links.