19

Differences

┌───────────────┬──────────┬──────────┬──────┬───────────┬─────┐
│               │ Absolute │ Relative │ File │ Directory │ UNC │
├───────────────┼──────────┼──────────┼──────┼───────────┼─────┤
│ Symbolic link │   Yes    │   Yes    │ Yes  │    Yes    │ Yes │
│ Junction      │   Yes    │    -     │  -   │    Yes    │  -  │
└───────────────┴──────────┴──────────┴──────┴───────────┴─────┘

Scenario

Let's assume we're creating a reparse point to create the redirect C:\SomeDir => D:\SomeDir

Since this scenario only requires local, absolute paths, either a junction or symlink would work. In this situation, is there any advantage to using one or the other?

Assume Windows 7 for the OS, disregarding backward-compatibility. (Prior to Vista, symlinks are not supported natively, though there is a 3rd-party driver that provides symlink support on Windows XP.)

Update

I have found another difference.

  • Symbolic Link - Link's permissions only affect delete/rename operations on the link itself, read/write access (to the target) is governed by the target's permissions
  • Junction - Junction's permissions affect enumeration, revoking permissions on the junction will deny file listing through that junction, even if the target folder has more permissive ACLs

The permissions make it interesting, as symlinks can allow legacy applications to access configuration files in UAC-restricted areas (such as %ProgramFiles%) without changing existing access permissions, by storing the files in a non-restricted location and creating symlinks in the restricted directory.

Update 2

Windows 8.1 will resolve symbolic directory links when navigating into one via the textbox in a Save As... dialog box. Junctions are not expanded.

5 Answers5

4

I understand NTFS symbolic links to be a replacement for Junctions on newer Windows OSes (Vista/7/8) as they function the same way but also provide additional functionality (remote points). So provided you're only working with newer operating systems, then there's no reason not to use the symbolic link option.

Garrett
  • 4,217
  • 1
  • 24
  • 33
2

I think junction points is has wider support in backup software than symbolic links. You should check with whatever backup program you're using what feature is supported.

If unsupported, the symlink/junction point will either be backed up as a separate directory (and restored as such), or not backed up at all.

Other than the backup issue, I don't see a reason to prefer one over the other, in your specific case (local directory).

haimg
  • 23,153
  • 17
  • 83
  • 117
1

NTFS junctions can only be pointed to directories, while symlinks also work on files.

grawity
  • 501,077
0

Maybe I've missed it somewhere in the comments, but one very important difference between symlinks and junctions in Windows for me are the needed privileges to create both. While symlinks are by default only creatable using special permissions default users don't have, junctions can be created easily by all default users OOB and are therefore my preferred link type for dirs.

By default, members of the Administrators group have this right.

https://docs.microsoft.com/en-us/windows/device-security/security-policy-settings/create-symbolic-links

0

Here is one difference which I have noticed:

I have a synced directory of scripts, portable apps, etc. I use a batch script to make a Junction in the Start Menu directory which points to a directory of shortcuts for the portable apps.

A Junction allows the shortcuts to appear in the Start Menu. When I use a Symbolic Link instead, it does not work.

paradroid
  • 23,297