I'm looking for a way to search for all the symbolic links on a NTFS filesystem on Windows Vista or 7.

It would be even better if I could specify a specific target to see if it has any symlinks pointing to it, but a way to search for them all would be great, too.

link|improve this question
feedback

3 Answers

Here's the best way I've found thus far:

dir /a:l /s

But it's ugly. I'd prefer a listing that showed one file per line in the format of target => source or something similar. Grepping for SYMLINK doesn't do well because of the multi-line format. The /B bare switch doesn't give anything but the target filename, too.

link|improve this answer
feedback

For all file searches on Windows systems i suggest using Everything. It's ultra fast and very lightweight.

link|improve this answer
Everything is neat, but doesn't seem to be able to filter by Windows junction points, symlinks, etc. – wojo Oct 8 '09 at 19:00
feedback

I too was looking for this capability and haven't seen it elsewhere. I've added it to my Windows libraries for Python. Unfortunately, if you aren't already an avid Python programmer, you have a few steps to get everything installed.

  1. Download Python 2.6.4 and install it.
  2. Download distribute-setup (part of distribute) or ez_setup (part of setuptools) and run the script. This installs one of the two package managers for Python that my package requires to run.
  3. Use easy_install to install the jaraco.windows package and its dependencies. From the command-prompt:

x

\Python26\scripts\easy_install jaraco.windows

After following these steps, you should have a script called \python26\scripts\find-symlinks.exe or \python26\scripts\find-symlinks-script.py which you can execute with an optional pathname to search out symlinks. It will search out the symlinks and report the results, one line each. I tested this procedure on a clean install of Windows 7.

> cmd /c mklink /d mylink \windows 
symbolic link created for mylink <<===>> \windows
> cmd /c mklink myfilelink \windows\notepad.exe
symbolic link created for myfilelink <<===>> \windows\notepad.exe

> \python26\scripts\find-symlinks
D .\mylink --> \windows
  .\myfilelink --> \windows\notepad.exe
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.