Question about Windows XP junctions and links

hexden

n00b
Joined
Nov 18, 2012
Messages
41
Is there a way to list all the junctions and symbolic links used on a computer running Windows XP and save that listing to a text file?
 
Code:
dir C:\ /S /A /B | find ".lnk" > output.txt && notepad output.txt

Might take a minute if the drive has alot of files and directories. Should probably turn word wrap off in notepad as well.
 
Last edited:
You could also do it via powershell. Assuming you're already in c:\

Code:
$list = get-childitem -Attributes "ReparsePoint" -Recurse -ea silentlycontinue

You'll need to figure out how to filter for the files you want. I found symlinks on my WIn7 system have an attribute of "ReparsePoint" (for both files and folders). I'm not sure what it would be listed as in XP, but I assume it would be the same.

Once it has cycled through your entire file system, you can do whatever you want with $list.

Code:
$list | ft FullName, LastWriteTime | out-file c:\temp\output.txt

Or you could export to csv or whatever. Obviously, you could skip using a variable if you really just want it exported to a text file, but I put everything in a variable in case I want to do other stuff with the data (i.e. foreach ($item in $list) {do-magic $item})
 
Back
Top