Quickly view all symbolic links, junctions points and hard links in a folder

Photo of author
Written By Jan Reilink

Windows Server systems administrator & enthusiast.

When you are migrating a file server to a new server, and transfer data to your new SMB share, you may need to recreate junction points, as they can’t be copied using (for example) Robocopy. Therefore it’s a must to know where you have junction points, and that’s where plain old DIR comes to the rescue.

How to find all symbolic links, junction points and hard links in a folder in Windows Server quickly? Use dir /al /s /b.

Displays a list of files and subdirectories in a directory.

DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N]
[/O[[:]sortorder]] [/P] [/Q] [/R] [/S] [/T[[:]timefield]] [/W] [/X] [/4]

Dir displays a list of files and subdirectories in a directory. The /A switch is display files with specified attributes, and L is for Reparse Points attribute. Use this in one switch: /al.

Use /s to display files in the specified directory and all subdirectories (e.g recursive), and /b to leave out heading information and summary.

Give it a try:

C:\>dir /al /b Documents and Settings

In PowerShell you find out about junction points, symbolic links and hard links using Get-ChildItem‘s LinkType filter:

Get-ChildItem . -Recurse -Force ` | ?{ $_.LinkType } ` | Select FullName, LinkType, Target
Code language: JavaScript (javascript)

Did you like: Quickly view all symbolic links, junctions points and hard links in a folder

Then please, take a second to support Sysadmins of the North and donate!

Your generosity helps pay for the ongoing costs associated with running this website like coffee, hosting services, library mirrors, domain renewals, time for article research, and coffee, just to name a few.



Hi! Join the discussion, leave a reply!