Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to see a list of all the symbolic links that are active on a Windows machine?

share|improve this question
up vote 38 down vote accepted

Try the following command:

dir /AL /S C:\
  • /A displays all files with a specific attribute, and L specifies reparse points (symlinks and directory junctions)
  • /S makes the command recursive
  • replace C:\ with the drive letter you want to scan, or with a path if you don't want to scan an entire drive
share|improve this answer
    
Thank you, I was beginning to lose track! – Louis Oct 30 '12 at 11:46
    
Is there a way to make it not recurse into symlinks / junctions so that it doesn't get stuck in an infinite loop? – BrainSlugs83 Oct 12 '14 at 1:09

In PowerShell

Dir C:\ -Force -Recurse -ErrorAction 'silentlycontinue' | 
  Where { $_.Attributes -match "ReparsePoint"}
  • -Force includes hidden and system files
  • -Recurse gets all child items
  • -ErrorAction 'silentlycontinue' suppresses Access to the path XYZ is denied errors
  • Where { $_.Attributes -match "ReparsePoint"} checks folders and files if it's a junction

Explanation of Mode attributes:

  • d - Directory
  • a - Archive
  • r - Read-only
  • h - Hidden
  • s - System
  • l - Reparse point, symlink, etc.
share|improve this answer
    
Thanks -- this could be really powerful for scripting -- is there a property that displays where the link goes to? -- it doesn't seem to be displayed by default, but if it's there we could script against it and that would be awesome. – BrainSlugs83 Oct 12 '14 at 1:11
    
@BrainSlugs83 To get the target of ReparsePoints programmatically , read this SO answer – nixda Dec 4 '14 at 23:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .