Skip to content

Symlinks, junctions and the long-path limit

Verified 2 min read

How symbolic links, junctions and hard links differ, when each is the right tool, and how to get past the 260-character path limit.

Tested onPro (26H2) / Server · Build 26300.9457 / 26100.33650 · x64
E1
Build
26300.9457 / 26100.33650
Edition
Pro (26H2) / Server
Architecture
x64
Support
Documentation (E1)
Evidence
E1Official documentation
Verified
2026-10-29
Page type
Method

Three link types, three very different behaviours:

Type Command Points to Survives move?
Symbolic link (file or dir) New-Item -ItemType SymbolicLink a path string breaks if target moves
Junction (directory only) New-Item -ItemType Junction a local volume path tracks the target
Hard link (file only) New-Item -ItemType HardLink the same file data is the file

Use a junction to relocate a folder that software insists on finding at a fixed path. Use a symlink when you want a transparent pointer and can accept the path dependency. Use a hard link almost never — it is the same file with two names.

Plenty of software hard-codes paths: C:\ProgramData\Vendor, C:\Users\Public\Documents, game save folders. You cannot change the app, and you do not want that data on the system drive.

Terminal window
# move the real folder to D:, leave a junction behind
Robocopy "C:\ProgramData\Vendor" "D:\Data\Vendor" /E /MOVE
New-Item -ItemType Junction -Path "C:\ProgramData\Vendor" -Target "D:\Data\Vendor"

/MOVE keeps the ACLs with /COPYALL if you add it; a plain move across volumes can lose explicit permissions on some setups.

The classic MAX_PATH is 260 characters. Windows 10 1607+ can exceed it, but only when both the policy is enabled and the application opts in via manifest.

  • Enable it: HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled = 1 (or Group Policy).
  • Applications built without long-path awareness still fail at 260.
  • Explorer, cmd.exe and some backup tools handle it differently.

Workarounds that always work:

  • Shorten the root — D:\p\ instead of D:\Projects\2026\Client Name\...
  • Use the \\?\ prefix for APIs that accept it (\\?\D:\very\long\path).
  • Keep OneDrive/SharePoint paths shallow — synced paths amplify the limit.
Terminal window
# current setting
Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name LongPathsEnabled
Tool Behaviour
Backup/sync tools may follow links (duplicating data) or skip them
robocopy /SL follows symlinks, /XJ skips junctions
Antivirus usually fine, occasionally loops on cyclic links
Disk usage tools double-count or refuse

Always tell your backup tool what to do with links, or you will either miss data or back up the same 500GB twice.

E1. Link semantics and the long-path policy are documented by Microsoft. No links were created on the lab VMs for this page.

Sources