General Find All Symbolic Links and Junction Points in Windows


  • Staff
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


 

Attachments

  • Shortcut.png
    Shortcut.png
    3.4 KB · Views: 156
Last edited:
I SO want to post that Schoolhouse Rock video... Conjunction Junction. :D
 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦22631.3374 ♦♦♦♦♦♦♦23H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 4702)
    Memory
    G.Skill (F4-3200C14D-16GTZKW)
    Graphics Card(s)
    EVGA RTX 2070 (08G-P4-2171-KR)
    Sound Card
    Realtek ALC1220P / ALC S1220A
    Monitor(s) Displays
    Dell U3011 30"
    Screen Resolution
    2560 x 1600
    Hard Drives
    2x Samsung 860 EVO 500GB,
    WD 4TB Black FZBX - SATA III,
    WD 8TB Black FZBX - SATA III,
    DRW-24B1ST CD/DVD Burner
    PSU
    PC Power & Cooling 750W Quad EPS12V
    Case
    Cooler Master ATCS 840 Tower
    Cooling
    CM Hyper 212 EVO (push/pull)
    Keyboard
    Ducky DK9008 Shine II Blue LED
    Mouse
    Logitech Optical M-100
    Internet Speed
    300/300
    Browser
    Firefox (latest)
    Antivirus
    Bitdefender Internet Security
    Other Info
    Speakers: Klipsch Pro Media 2.1
  • Operating System
    Windows XP Pro 32bit w/SP3
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® (not in use)
    CPU
    AMD Athlon 64 X2 5000+ (OC'd @ 3.2Ghz)
    Motherboard
    ASUS M2N32-SLI Deluxe Wireless Edition
    Memory
    TWIN2X2048-6400C4DHX (2 x 1GB, DDR2 800)
    Graphics card(s)
    EVGA 256-P2-N758-TR GeForce 8600GT SSC
    Sound Card
    Onboard
    Monitor(s) Displays
    ViewSonic G90FB Black 19" Professional (CRT)
    Screen Resolution
    up to 2048 x 1536
    Hard Drives
    WD 36GB 10,000rpm Raptor SATA
    Seagate 80GB 7200rpm SATA
    Lite-On LTR-52246S CD/RW
    Lite-On LH-18A1P CD/DVD Burner
    PSU
    PC Power & Cooling Silencer 750 Quad EPS12V
    Case
    Generic Beige case, 80mm fans
    Cooling
    ZALMAN 9500A 92mm CPU Cooler
    Mouse
    Logitech Optical M-BT96a
    Keyboard
    Logitech Classic Keybooard 200
    Internet Speed
    300/300
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?
It doesn't work if the folder tree contains one or more files/folders that have special characters in their name. I wrote a fix, but only did some quick preliminary testing, so please let me know if it works or doesn't work.
Code:
echo off & chcp 65001>nul & cmd /q /c "for /F "delims= usebackq" %A in (`dir /s /b`) do (for /F "delims= usebackq" %B in (`fsutil hardlink list "\\?\%A"`) do (if not %A==%~dA%B (chcp 437>nul & echo %A& echo %~dA%B& echo.& chcp 65001>nul)))">"%UserProfile%\Desktop\HardLinks.txt" & chcp 437>nul & echo on
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming (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
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • 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
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
Thanks, wasn't aware of these. I have always used Windows Sysinternals junction.exe:


Using Junction​

Syntax​

  • To obtain reparse point information: junction.exe [-s] [-q] <file or directory>
  • To create a junction point: junction.exe <junction directory> <junction target>
  • To delete a junction point: junction.exe -d <junction directory>
 

My Computers

System One System Two

  • OS
    Windows 11 Pro x64
    Computer type
    PC/Desktop
    Manufacturer/Model
    DIY Photoshop/Game/tinker build
    CPU
    Intel i9 1300KS
    Motherboard
    Asus ROG Maximus Z90 Dark Hero
    Memory
    64GB (2x32) G.skill Trident Z5 RGB 6400 MHZ 32-39-39
    Graphics Card(s)
    Asus ROG Strix 4070 Ti OC
    Sound Card
    Onboard Audio, Vanatoo Transparent One; Klipsch R-12SWi Sub; Creative Pebble Pro Minimilist
    Monitor(s) Displays
    Eizo CG2730, ViewSonic VP2768
    Screen Resolution
    2560 x 1440p x 2
    Hard Drives
    WDC SN850 1TB nvme, SK-Hynix 2 TB P41 nvme, Raid 0: 1TB 850 EVO + 1TB 860 EVO SSD. Sabrent USB-C DS-SC5B 5-bay docking station: 6TB WDC Black, 6TB Ironwolf Pro; 2x 2TB WDC Black
    PSU
    850W Seasonic Vertex PX-850
    Case
    Fractal Design North XL Mesh, Black Walnut
    Cooling
    EKWB 360 Nucleus Dark AIO w/Phanteks T30-120 fans, 1 Noctua NF-A14 Chromax case fan
    Keyboard
    Glorious GMMK TKL mechanical, lubed modded
    Mouse
    Logitech G305 wireless gaming
    Internet Speed
    380 Mb/s down, 12 Mb/s up
    Browser
    Firefox
    Antivirus
    Defender, Macrium Reflect 8 ;-)
  • Computer type
    Laptop
    Manufacturer/Model
    Apple 13" Macbook Pro 2020 (m1)
    CPU
    Apple M1
    Screen Resolution
    2560x1600
    Browser
    Firefox
Better Option Install
Link Shell Extension

As well as giving you a powerful Shell Extension, With Properties page and Link Creation via Context Menu, it provides very useful Overlays that show when a link is used, and what Type of Link it is.

Win 7 Style I use these, don't think these are still part of program, because I detest the crappy flat "Modern", style of Win 8/10/11
As you can add your own overlay Icons, you can just grab these if you want.
Symbolic Link Hardlink Junction
Link Shell Extension – Pic 64 – Overlay Icon For Symbolic Links – Windows 7 Style.PNG
Link Shell Extension – Pic 04 – Overlay Icon For HardLinks – Windows 7 Style.PNG
Link Shell Extension – Pic 16 – Overlay Icon For Junctions – Windows 7 Style.PNG


Win 10 Style
Symbolic Link Hardlink Junction
Link Shell Extension – Pic 65 – Overlay Icon For Symbolic Links – Windows 10 Style.PNG
Link Shell Extension – Pic 05 – Overlay Icon For HardLinks – Windows 10 Style.PNG
Link Shell Extension – Pic 17 – Overlay Icon For Junctions – Windows 10 Style.PNG


Which ever you choose, it makes managing links much easier.

Especially useful for spotting Stuff not added to Windows via Update, no Hardlink not Update.
Like here with a file installed with my Sound Card Drivers, to add a Control Panel entry, and Sys Tray functions.
2022-08-25 08_04_22-Greenshot.jpg
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Pro v22H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Uhuru N'Uru PC
    CPU
    AMD Ryzen 7 7800X3D, 4.2GHz Turbo 5.0GHz [2023-04-17]
    Motherboard
    Asus ROG Crosshair X670E Hero – UEFI BIOS v1410 Beta [2023-04-18]
    Memory
    64GB (2x32GB) GSkill Trident Z5 Neo DDR5-6000 CL30-40-40-96 – F5-6000J3040G32GX2-TZ5N [2023-04-21]
    Graphics Card(s)
    EVGA GeForce RTX 3080Ti FTW3 Ultra Gaming, 12GB GDDR6X, iCX3 – 12G-P5-3967-KR [2021-11-24]
    Monitor(s) Displays
    ASUS ROG Swift PG329Q Gaming Monitor – 32” 165Hz G-Sync Compatible [2021-07-07] + 2×Dell U2711 A12 – 27” 60Hz [2013-04-03]
    Screen Resolution
    7680×1440 = 3×(2560×1440) – Game on PG329Q only.
    Hard Drives
    M.2 NVMe: (4 slots, 1 used)
    2TB – WD Black SN750 – WDS200T3XHC [2020-07-10]
    SATA 3: (6 slots)
    SSD: (1.75TB Total)
    1TB – Samsung 850 Pro – MZ-7KE1T0BW [2018-03-28]
    512GB – Samsung 840 Pro – MZ-7TD500BW [2013-04-03]
    256GB – OCZ Vertex 4 – VTX4-25SAT3-256G [2013-04-03]
    HDD: (22TB Total)
    8TB – Seagate BarraCuda – ST8000DM004 [2021-04-25]
    8TB – Seagate BarraCuda – ST8000DM004 [2021-04-25]
    6TB – Western Digital WD6002FZWX Black [2017-07-08]
    PSU
    1200W – Corsair Professional Series AX1200 Full Modular, 80 Plus Gold – CMPSU-1200AXUK [2013-04-03]
    Case
    Corsair Obsidian Series 650D All Black Mid Tower Case – CC650DW-1 [2013-04-03]
    Cooling
    Arctic Liquid Freezer II 360, All-In-One Hydro CPU Cooler, 3x120mm PWM Fan, Aluminium/Copper – 7L7H8 [2023-04-22] + 3×Noctua F12 Industrial IP67 PW, 120mm – NF-F12-IPPC-2000-IP67-PWM [2018-03-28]
    Keyboard
    Corsair Vengeance K90 Performance with MX Red Mechanical Switches [2013-04-03]
    Mouse
    Logitech G502 Hero High Performance Wired Gaming Mouse [2022-01-22]
    Internet Speed
    Download = 1,130Mbps (141.25 MB/s), Upload = 52Mbps (6.5 MB/s), UK law allows, ISPs exploit
    Browser
    Pale Moon
    Antivirus
    Basically myself as Comodo Internet Security set to ask my permission on 1st Access
    Other Info
    Audio-Technica ATH-M50X Studio Monitor Professional Headphones - Black [2021-02-25] + Backup Set [2017-10-26]

Latest Support Threads

Back
Top Bottom