You are here: Home » Windows Server » Quickly view all symbolic links, junctions points and hard links in a folder
birds eye view of asphalt road

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

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

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.

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 can use LinkType as a filter:

Get-ChildItem . -Recurse -Force `
	| ?{ $_.LinkType } `
	| Select FullName, LinkType, Target

Did this post helped you solve a problem? Or dit you find it interesting? Support Sysadmins of the North with a direct donation via Paypal of by bank wire transfer IBAN: NL31 ABNA 0432217258 (Jan Reilink). Just $ 5,- or € 5,- is more than enough, thanks!

Support SAOTN.ORG


Leave a Comment

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

27 queries, took 0.571 seconds running PHP version 7.4.8