General Find All Symbolic Links and Junction Points in Windows


  • Staff
Shortcut_banner.png

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.

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.


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: 53
Last edited:

Ghot

Well-known member
Pro User
VIP
Local time
10:03 AM
Posts
4,922
Location
PA, USA
OS
Win 11 Home ♦♦♦22621.900 ♦♦♦♦♦♦22H2
I SO want to post that Schoolhouse Rock video... Conjunction Junction. :D
 

My Computers

System One System Two

  • OS
    Win 11 Home ♦♦♦22621.900 ♦♦♦♦♦♦22H2
    Computer type
    PC/Desktop
    Manufacturer/Model
    Built by Ghot® [May 2020]
    CPU
    AMD Ryzen 7 3700X
    Motherboard
    Asus Pro WS X570-ACE (BIOS 4201)
    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
    100/100
    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
    100/100
    Browser
    Firefox 3.x ??
    Antivirus
    Symantec (Norton)
    Other Info
    Still assembled, still runs. Haven't turned it on for 13 years?

    http://www.xtremesystems.org/forums/showthread.php?183088-5000-B-E-on-M2N32-SLI-Dlx-Overclocked&p=2891724#post2891724

hdmi

Well-known member
Power User
VIP
Local time
4:03 PM
Posts
759
Location
Belgium
OS
11 Home
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 Computer

System One

  • OS
    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
    20Mbit/s up, 200Mbit/s down
    Browser
    FF

geneo

Well-known member
Power User
VIP
Local time
10:03 AM
Posts
2,199
OS
Windows 11 Pro x64
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
    CPU
    10900K, 5.2 GHz (4.9 GHz uncore) all-core
    Motherboard
    Asus ROG Maximus Hero XIII Wifi
    Memory
    64GB (2x32) G.skill TridentZ RGB 4266 MHz CL18
    Graphics Card(s)
    Asus ROG Strix 2070 Super A8G
    Sound Card
    Onboard Audio, Vanatoo Transparent One; Klipsch R-12SWi Sub
    Monitor(s) Displays
    Eizo CG2730, ViewSonic VP2768
    Screen Resolution
    2560 x 1440p x 2
    Hard Drives
    WDC SN850 1TB (OS+), Samsung 980 1TB (games), Raid 0: 1TB 850 EVO + 1TB 860 EVO. Sabrent USB-C DS-SC5B docking station: 6TB WDC Black, 6TB Ironwolf Pro; 2x 2TB WDC Black
    PSU
    750W Seasonic Prime Ultra Titanium Plus
    Case
    Fractal Design Meshify 2 dark tint glass
    Cooling
    EK-AIO 360 D-RGB w/Phanteks T30-120 fans, Noctua NF-A14 Chromax case fan
    Keyboard
    Glorious GMMK TKL - Brown mechanical, lubed modded
    Mouse
    Logitech G305 wireless gaming
    Internet Speed
    350 Mb/s down, 12 Mb/s up
    Browser
    Firefox
    Antivirus
    Defender, Macrium Reflect 8 ;-)
    Other Info
    Logitech C920e Webcam (crap don't buy)
  • Operating System
    Mac OS
    Computer type
    Laptop
    Manufacturer/Model
    Apple 13" Macbook Pro 2020 (m1)
    CPU
    M1
    Monitor(s) Displays
    2560x1600

Uhuru

Member
Local time
3:03 PM
Posts
12
OS
Windows 11 Pro v22H2
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
    Intel Core i7 8770K, 3.7GHz (5.0Ghz OC) [2018-10-04]
    Motherboard
    Asus ROG Maximus X Hero – UEFI BIOS v2701 [2018-10-04]
    Memory
    32GB (2×16GB) Corsair Vengeance LPX DDR4 PC4-24000 (3000MHz) C16 – CMK32GX4M2D3000C16 [2018-10-04]
    Graphics Card(s)
    EVGA GeForce RTX 3080Ti FTW3 Ultra Gaming, 12GB GDDR6X, iCX3 – 12G-P5-3967-KR [2021-11-24]
    Sound Card
    ASUS Xonar D2X Ultra Fidelity 7.1 Hi-Def PCI-Express Dolby/DTS [2013-04-03]
    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)
    Hard Drives
    M.2 NVMe: (2 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
    Corsair Hydro H100x Liquid CPU Cooler, 240 mm Radiator – CW-9060040-WW [2018-10-04] + Noctua F12 Industrial IP67 PW, 120mm – Two Radiator + Back Case – 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
    Down=200 Megabit (25 MB/s) – Up=20 Megabit (2.5 MB/s)
    Browser
    Pale Moon
    Antivirus
    Comodo Internet Security
    Other Info
    Audio-Technica ATH-M50X Studio Monitor Professional Headphones - Black [2021-02-25]
    Backup [2017-10-26]
Top Bottom