General Find All Symbolic Links and Junction Points in Windows

  • Thread starter Thread starter Brink
  • Start date Published: Start date Updated Updated:

Shortcut_banner.png

This tutorial will show you how to find and list all hard links, symbolic links, and junction points and their target source in Windows 10 and Windows 11.

There are three types of file links supported in the NTFS file system: hard links, junctions, and symbolic links. Otherwise known as Reparse Points.

Hard Links can only be created for files. Any changes to that file are instantly visible to applications that access it through the hard links that reference it. Hard links do not support UNC paths (network paths that begin with \\). Hard links to a file will not have a shortcut arrow icon on them.

Symbolic Links are soft links that are basically advanced shortcuts. You can create a symbolic link to a local or remote file, folder, or shares path, and that link will appear to be the same as the target source. Symbolic links do support UNC paths (network paths that begin with \\). When you open a symbolic link, you will be redirected to the target source. Symbolic links will have a shortcut arrow icon on them.

Junctions (Directory Junction) are soft links that can only be created to a local folder (directory) path. Junction points make it appear as though folder (directory) actually exists at the location of the junction point, and your app won’t know any better. Junction points do not support UNC paths (network paths that begin with \\). Junction points will have a shortcut arrow icon on them.

Deleting anything in the link/junction or target (source) folder will delete it in both folders.

Deleting the hard link, symbolic link, or junction point itself will not delete anything in the target (source) folder.


Contents





Option One

Find All Symbolic Links and Junction Points


1 Open a command prompt or elevated command prompt (recommended).

2 Type the command below you want to use into the command prompt, and press Enter. (see screenshot below)

(Output in command prompt)
DIR /AL /S "Directory Path"

OR​

(Output to "Links.txt" file on desktop)
DIR /AL /S "Directory Path" > "%UserProfile%\Desktop\Links.txt"

Substitute Directory Path in the command above with the actual full path of the drive or folder you want to search in to find and list all symbolic links and junction points.

Folder example: DIR /AL /S "C:\Users\Brink\Downloads" or DIR /AL /S "C:\Users\Brink\Downloads" > "%UserProfile%\Desktop\Links.txt"

Drive example: DIR /AL /S "C:\" or DIR /AL /S "C:\" > "%UserProfile%\Desktop\Links.txt"



3 You will now see a Directory of <path> listed for each folder symbolic links and/or junction points were found in. Under this path you will see the link file/folder name and its target source path.

Types of links:
  • <JUNCTION> = Junction point to folder (directory)
  • <SYMLINK> = Symbolic link to file
  • <SYMLINKD> = Symbolic link to folder (directory)

List_of_symbolic_links.jpg





Option Two

Find All Hard Links


1 Open a command prompt or elevated command prompt (recommended).

2 Type the command below into the command prompt, and press Enter. (see screenshot below)

CD "Directory Path"

Substitute Directory Path in the command above with the actual full path of the drive or folder you want to search in to find and list all hard links.

Folder example: CD "C:\Users\Brink\Downloads"


3 Copy and paste the command below into the command prompt, and press Enter. (see screenshot below)

(Output in command prompt)
echo off & for /F "delims=" %A in ('dir /s /b') do echo. & fsutil hardlink list "%A"

OR​

(Output to "HardLinks.txt" file on desktop)
echo off & for /F "delims=" %A in ('dir /s /b') do echo. & fsutil hardlink list "%A" > "%UserProfile%\Desktop\HardLinks.txt"


4 You will now see a list of full paths for all files found in the directory from step 2.
  • A single isolated line means the it's a normal file. You can ignore this.
  • Two lines together means it's a hard link. The top path will be for the hard link, and the bottom path will be for it's target source.

Find_hard_links_command.png



That's it,
Shawn Brink


 
Last edited:
Last edited:

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    30Mbit/s up, 500Mbit/s down
    Browser
    FF
    Antivirus
    What's an antivirus?
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    30Mbit/s up, 500Mbit/s down
    Browser
    FF
I was wondering, are there any multi-threaded solutions that exist that aren't quite so slow?
I know of and use:
3 of these are great for creating reparse points, but not viewing and managing what exists. CodeDek's is pretty good, probably the BEST I have fund. But Symlink Creator is very good, allowing you to specify multiple paths to a destination....

I was wondering if something better existed? Any other tools?
eg. even if just under your profile path. OR can perform a scan and simply update it's known locations, without performing a full exhaustive scan...?
Does that make sense?? Cheers!

Plus being bombarded with error messages and waiting hours for a text file is just not practical... :P
1753881947009.webp

Plus I find Get-ChildItem -Recurse -Attributes ReparsePoint only works from C:\ an not from my profile folder.

Deleting the hard link, symbolic link, or junction point itself will not delete anything in the target (source) folder.

I thought there was a reparse point that if deleted it also deleted from the other end of the link? I have seen warnings not to delete xyz. Can anyone confirm? Thanks :)

There are three types of file links supported in the NTFS file system: hard links, junctions, and symbolic links. Otherwise known as Reparse Points.

Hard Links can only be created for files. Any changes to that file are instantly visible to applications that access it through the hard links that reference it. Hard links do not support UNC paths (network paths that begin with \\). Hard links to a file will not have a shortcut arrow icon on them.

Symbolic Links are soft links that are basically advanced shortcuts. You can create a symbolic link to a local or remote file, folder, or shares path, and that link will appear to be the same as the target source. Symbolic links do support UNC paths (network paths that begin with \\). When you open a symbolic link, you will be redirected to the target source. Symbolic links will have a shortcut arrow icon on them.

Junctions (Directory Junction) are soft links that can only be created to a local folder (directory) path. Junction points make it appear as though folder (directory) actually exists at the location of the junction point, and your app won’t know any better. Junction points do not support UNC paths (network paths that begin with \\). Junction points will have a shortcut arrow icon on them.

Deleting anything in the link/junction or target (source) folder will delete it in both folders.

Deleting the hard link, symbolic link, or junction point itself will not delete anything in the target (source) folder.




Option One

Find All Symbolic Links & Junction Points


Folder example: DIR /AL /S "C:\Users\Brink\Downloads" or DIR /AL /S "C:\Users\Brink\Downloads" > "%UserProfile%\Desktop\Links.txt"

Drive example: DIR /AL /S "C:\" or DIR /AL /S "C:\" > "%UserProfile%\Desktop\Links.txt"[/n2]

3 You will now see a Directory of <path> listed for each folder symbolic links and/or junction points were found in. Under this path you will see the link file/folder name and its target source path.

Types of links:
  • <JUNCTION> = Junction point to folder (directory)
  • <SYMLINK> = Symbolic link to file
  • <SYMLINKD> = Symbolic link to folder (directory)



Option Two

Find All Hard Links



CD "Directory Path"
(Output in command prompt)
echo off & for /F "delims=" %A in ('dir /s /b') do echo. & fsutil hardlink list "%A"

OR​

(Output to "HardLinks.txt" file on desktop)
echo off & for /F "delims=" %A in ('dir /s /b') do echo. & fsutil hardlink list "%A" > "%UserProfile%\Desktop\HardLinks.txt"

4 You will now see a list of full paths for all files found in the directory from step 2.
  • A single isolated line means the it's a normal file. You can ignore this.
  • Two lines together means it's a hard link. The top path will be for the hard link, and the bottom path will be for it's target source.
 
Last edited:

My Computers

System One System Two

  • OS
    w11
    Computer type
    Laptop
    Manufacturer/Model
    Gigabyte Aero 17
    CPU
    i7-12700H
    Memory
    64GB DDR4
    Graphics Card(s)
    Something big I will never take advantage of!
    Monitor(s) Displays
    17.3" 4K UHD
    Browser
    Yandex Browser (10x better than Chrome!) or Brave
    Antivirus
    MBAM + ESET + WFC + KTS
  • Operating System
    W7
@Flipmode

I have no idea what you mean by "known locations".
Finding Junctions and Symbolic links should be fairly straigtforward and fast with tools like Everything 1.5 and Link Shell Extension (especially if you have set up the latter such a way that it shows the icon overlays so you can distinguish visually), but for hardlinks you might also want to check out the Ln command line tool.

Enumerate hardlinks: --enum or -e
ln -e Path
recursively:
ln -e Path -r
with an additional path:
ln --source Path2 -e Path
with multiple additional paths:
ln --source Path2 --source Path3 -e Path

List Hardlink siblings: --list or -l
ln -l filename

Get the Target of a Junction: --junction or -j
ln -j JunctionName

Get the Target of a Symbolic Link: --symbolic or -s
ln -s SymbolicLinkName
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    30Mbit/s up, 500Mbit/s down
    Browser
    FF
    Antivirus
    What's an antivirus?
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    30Mbit/s up, 500Mbit/s down
    Browser
    FF
I thought there was a reparse point that if deleted it also deleted from the other end of the link? I have seen warnings not to delete xyz. Can anyone confirm?
Yeah, if you try to remove a junction by running the del command it will delete files from the junction's target, whereas running the rmdir or rd command will only remove the link itself.
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    30Mbit/s up, 500Mbit/s down
    Browser
    FF
    Antivirus
    What's an antivirus?
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    30Mbit/s up, 500Mbit/s down
    Browser
    FF
I've had the HardLinks command from the initial tutorial running since Friday on a Windows 10 machine and it's still going with no file created yet. Anyone have any suggestions or ideas as to what is going on?
I know I created at least one link on that machine and being Windows 10, it needs to be shut down and go away, but I want to recreate it on the replacement Win 11 machine.
@Brink
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
I've had the HardLinks command from the initial tutorial running since Friday on a Windows 10 machine and it's still going with no file created yet. Anyone have any suggestions or ideas as to what is going on?
I know I created at least one link on that machine and being Windows 10, it needs to be shut down and go away, but I want to recreate it on the replacement Win 11 machine.
@Brink

Hello, and welcome to the tutorial. :alien:

Something is not right if it's been hung or running that long. You can safely close the terminal window though.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
Hello, and welcome to the tutorial. :alien:

Something is not right if it's been hung or running that long. You can safely close the terminal window though.
Thanks. I killed it. I'll try some of the commands in other comments.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo

My Computers

System One System Two

  • OS
    Windows 11 Pro for Workstations
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom self build
    CPU
    Intel i7-8700K 5 GHz
    Motherboard
    ASUS ROG Maximus XI Formula Z390
    Memory
    64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz (F4-3600C18D-32GTZR)
    Graphics Card(s)
    ASUS ROG-STRIX-GTX1080TI-O11G-GAMING (11GB GDDR5X)
    Sound Card
    Integrated Digital Audio (S/PDIF)
    Monitor(s) Displays
    2 x Samsung Odyssey G75 27"
    Screen Resolution
    2560x1440
    Hard Drives
    1TB Samsung 990 PRO M.2,
    4TB Samsung 990 PRO M.2,
    TerraMaster F8 SSD Plus NAS
    PSU
    Seasonic Prime Titanium 850W
    Case
    Thermaltake Core P3 wall mounted
    Cooling
    Corsair Hydro H115i
    Keyboard
    Amazon Basics Wired Full Keyboard MD005
    Mouse
    Logitech MX Master 4
    Internet Speed
    2 Gbps Download and 100 Mbps Upload
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender
    Other Info
    Logitech Z625 speaker system,
    Logitech BRIO 4K Pro webcam,
    HP Color LaserJet Pro MFP M477fdn,
    CyberPower CP1500PFCLCD
    Galaxy S23 Plus phone
  • Operating System
    Windows 11 Pro
    Computer type
    Laptop
    Manufacturer/Model
    Surface Laptop 7 Copilot+ PC
    CPU
    Snapdragon X Elite (12 core) 3.42 GHz
    Memory
    16 GB LPDDR5x-7467 MHz
    Monitor(s) Displays
    15" HDR
    Screen Resolution
    2496 x 1664
    Hard Drives
    1 TB SSD
    Internet Speed
    Wi-Fi 7 and Bluetooth 5.4
    Browser
    Chrome and Edge
    Antivirus
    Microsoft Defender

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom Built
    CPU
    AMD Ryzen 9 5950X
    Motherboard
    MAG X5750 Tomahawk Max Wifi
    Memory
    64 GB DDR4
    Graphics Card(s)
    Nvidia GeForce RTX 3070
    Sound Card
    N/A
    Monitor(s) Displays
    Viotek
    Screen Resolution
    1920 x 1080
Back
Top Bottom