Windows supports three distinct types of filesystem links: symbolic links, directory junctions, and hard links. They look similar from the outside but behave differently in ways that matter — across drives, across reboots, under backup software, and under deletion. This reference article explains each type, when to use it, and what to expect from each one in a real environment.
Quick reference
| Feature | Symbolic link (/D) | Junction (/J) | Hard link (/H) |
|---|---|---|---|
| Target type | File or folder | Folder only | File only |
| Cross-drive | ✓ | ✓ | — |
| Network paths | ✓ (with GPO) | — | — |
| Admin required to create | ✓ | ✓ | ✓ |
| Legacy app compatibility | Partial | High | High |
| Visible in Explorer | Shortcut icon | Shortcut icon | Normal file |
| Target deleted → link breaks | ✓ | ✓ | — (data survives) |
| CMD create command | mklink /D | mklink /J | mklink /H |
| PowerShell create command | New-Item -ItemType SymbolicLink | New-Item -ItemType Junction | New-Item -ItemType HardLink |
How each link type works
Symbolic link
A symbolic link is a filesystem pointer stored as a reparse point on the NTFS volume. When an application opens the link path, the OS resolves the pointer at access time and transparently redirects the operation to the target. The target can be a file or folder on any drive, or a network path (with Group Policy enabled).
Symbolic links are the most flexible type. They work across drives and volumes, support both files and directories, and are transparent to almost all modern applications. The trade-off is that they require administrator privileges to create and, in some legacy environments, may not be followed correctly by older installers.
:: Create a directory symbolic link
mklink /D "C:\LinkedFolder" "D:\RealFolder"
:: Create a file symbolic link
mklink "C:\Linked\config.ini" "D:\Configs\app.ini"
Junction
A junction is a folder-only link that also uses NTFS reparse points but with a different internal mechanism. Junctions were introduced before symbolic links and are supported on all Windows versions from 2000 onward. They are more compatible with legacy software, system-managed folders, and older installers that may not correctly follow symbolic links.
Junctions work across drives on the local machine but cannot point to network paths. For most AppData redirection and legacy app compatibility scenarios, a junction is the safer choice.
:: Create a directory junction
mklink /J "C:\OldApp\Data" "D:\AppStorage\Data"
Hard link
A hard link is fundamentally different from the other two types. It does not create a pointer to another location — it creates a second directory entry for the same file data on disk. Both paths are equal: there is no “original” and no “copy”. The underlying file data is reference-counted by the NTFS filesystem and only deleted when all hard links pointing to it are removed.
Hard links are restricted to files and must remain on the same NTFS volume. They are invisible to most applications — Explorer, dir, and most tools show them as regular files.
:: Create a hard link — both paths point to the same file data
mklink /H "C:\App2\Logs\current.log" "C:\App1\Logs\output.log"
When to use which
| Scenario | Best choice | Why |
|---|---|---|
| Sync an app folder to OneDrive or Dropbox | Symbolic link /D | Works across drives, transparent to the app |
| Redirect AppData to a secondary drive | Junction /J | Better compatibility with system-managed paths |
| Legacy app with hardcoded path | Junction /J | Older installers may not follow symlinks |
| Same file needed in two script locations | Hard link /H | No pointer — both paths are the file |
| Link to a network share | Symbolic link /D | Only type that supports UNC paths (GPO required) |
| Dev environment: shared test data | Symbolic link /D | Cross-drive, easy to rebuild, transparent |
| Reduce duplication of identical files on same drive | Hard link /H | Single copy on disk, multiple access paths |
Behavioral differences worth knowing
Deletion behavior differs by type
For symbolic links and junctions: deleting the link with rd removes only the link entry. The target is untouched. Deleting the target leaves the link broken. For hard links: deleting one path removes that entry, but the file data persists until all hard links to it are removed.
rd /S on a symbolic link or junction deletes the target directory contents, not just the link. Always use rd without /S to remove a link safely.
Backup software may not handle links correctly
Some backup tools follow symbolic links and junctions during backup, duplicating the target data at the link location. Others skip links entirely. Hard links may be backed up multiple times as separate files. Always verify how your backup solution handles each link type before deploying links in backed-up paths.
Hard links are invisible to most inspection tools
File Explorer, dir, and most utilities show hard links as normal files with no indicator that a second path exists. To inspect hard links, use fsutil hardlink list "C:\path\to\file". For symbolic links and junctions, use dir /AL.
:: Inspect symbolic links and junctions in current directory
dir /AL
:: List all hard link paths for a specific file
fsutil hardlink list "C:\App1\Logs\output.log"
Official reference
mklink — Windows Commands | Microsoft Learn
Related guides
- mklink in Windows: symlinks, junctions, and when to use each
- How to delete a symbolic link on Windows without deleting the target
- How to list all symbolic links on Windows — coming soon
- Base64 encoding in PowerShell: encode and decode files and strings
