How to list all symbolic links on an NTFS filesystem
Asked Answered
P

3

28

since Windows Vista there is an new Win32-API call CreateSymbolicLink to create a symbolic link on the NTFS filesystem.

Does anyone know if there is an way to list all existing symbolic links on the filesystem?

Policyholder answered 20/3, 2010 at 12:39 Comment(0)
L
6

Following the links in that article takes you to this one. Quoting:

To determine if a specified directory is a mounted folder, first call the GetFileAttributes function and inspect the FILE_ATTRIBUTE_REPARSE_POINT flag in the return value to see if the directory has an associated reparse point. If it does, use the FindFirstFile and FindNextFile functions to obtain the reparse tag in the dwReserved0 member of the WIN32_FIND_DATA structure. To determine if the reparse point is a mounted folder (and not some other form of reparse point), test whether the tag value equals the value IO_REPARSE_TAG_MOUNT_POINT. For more information, see Reparse Points.

Lajuanalake answered 20/3, 2010 at 15:30 Comment(0)
I
85

Window-key -> cmd -> dir /AL /S c:\

Copy-paste from comment on -> http://windows7themes.net/how-to-find-all-symbolic-links-junction-points-in-windows-7.html

You can of course put any other drive label instead of c:\

Ireneirenic answered 22/7, 2011 at 21:41 Comment(3)
While it's not an answer to the question, it is related and what I happened to be looking for. Churbrew!Lilylivered
I tried it -- Looks like an answer to the question to me. All symbolic links on the drive show <SYMLINKD>, and all junction points say <JUNCTION>. So if you only want symbolic links, filter the result...Navigator
dir hangs in an infinite loop if you have recursive reparse points (a stupid thing to have as it trips up most software dealing with directory trees, but the AppData folder of my standard W7 installation has them by default). Nfts_Links_View as recommended by Tristan doesn't have this problem.Jemine
H
9

You can also use this free GUI tool:

http://www.nirsoft.net/utils/ntfs_links_view.html

Harrell answered 30/10, 2014 at 14:1 Comment(0)
L
6

Following the links in that article takes you to this one. Quoting:

To determine if a specified directory is a mounted folder, first call the GetFileAttributes function and inspect the FILE_ATTRIBUTE_REPARSE_POINT flag in the return value to see if the directory has an associated reparse point. If it does, use the FindFirstFile and FindNextFile functions to obtain the reparse tag in the dwReserved0 member of the WIN32_FIND_DATA structure. To determine if the reparse point is a mounted folder (and not some other form of reparse point), test whether the tag value equals the value IO_REPARSE_TAG_MOUNT_POINT. For more information, see Reparse Points.

Lajuanalake answered 20/3, 2010 at 15:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.