You are here: Sysadmins of the North » Windows Server » Quickly view all symbolic links, junctions points and hard links in a folder

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

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, TargetCode language: JavaScript (javascript)

Show Your Support

donate with Paypal

If you want to step in to help me cover the costs for running this website, that would be awesome. Just use this link to donate a cup of coffee ☕($10 USD or €10 EUR for example). And please share the love and help others make use of this website. Thank you very much! <3 ❤️

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top