Home » Questions » Computers [ Ask a new question ]

How can I find all symlinks in Windows Vista or 7?

How can I find all symlinks in Windows Vista or 7?

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

Asked by: Guest | Views: 353
Total answers/comments: 3
Guest [Entry]

Try SageLinks - a small freeware open-source utility for Windows, it can find and re-check all symlinks as well as junctions and shortcuts:
Guest [Entry]

"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.

Download Python 2.6.4 and install it.
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.
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"
Guest [Entry]

"Cygwin/bash script for win7

c:\> cat find-dead-links.sh
#!/usr/bin/bash
find . -maxdepth 3 -type l -print0 |
while IFS= read -r -d $'\0' file ;do
[[ -e ""$file"" ]] && continue
echo ""Bad link $file""
done"