Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Get both path to and target of symbolic link/junction...

May
855
0
One one hand, I use a lot of symbolic links. On the other hand this leads to much duplication when backing up to an external hard drive unless the "/L" parameter is used, but I would assume that those copied symbolic links point to the location of the directory on the internal hard disk that is the source of the backup. (This is actually OK other than the fact that I'd like to know that the links exist.) So the question is this: Is there any way to get a listing of all of the symbolic links on a hard drive and where they "point" to? The "dir" command will tell you that a directory is a symbolic link/junction and what it points to but will not tell you (on the same line as is done when using the "/F" parameter) what directory contains the symbolic link/junction. "Dir /F" will tell you the full path to a symbolic link/junction but not that it is a symbolic link/junction much less what the symbolic link/junction points to. "PDIr" iif any field selection parameters are supplied doesn't show what a symbolic link/junction points to and there is no field-selection parameter that I can see that gives you this information. So is there any way short of writing a program/batch file that I can get this information?
 
I don't know how thorough or accurate this is but ...
Code:
v:\> do j in /p dir /f /s /a:L c:\ ( echo %j = %@truename[%j] )
C:\Documents and Settings = C:\Users
C:\ProgramData\Application Data = C:\ProgramData
C:\ProgramData\Desktop = C:\Users\Public\Desktop
C:\ProgramData\Documents = C:\Users\Public\Documents
C:\ProgramData\Favorites = C:\Users\Public\Favorites
C:\ProgramData\Start Menu = C:\ProgramData\Microsoft\Windows\Start Menu
C:\ProgramData\Templates = C:\ProgramData\Microsoft\Windows\Templates
<SNIP>
C:\Users\vefatica\Documents\My Music = C:\Users\vefatica\Music
C:\Users\vefatica\Documents\My Pictures = C:\Users\vefatica\Pictures
C:\Users\vefatica\Documents\My Videos = C:\Users\vefatica\Videos
 
Vince, that was close and it gave me an idea of how to do it in an even much simpler manner. To wit:
Code:
For /R Z:\. /D %D in (*) Do (If "%D" != "%@TrueName[%D]" Echo "%D" "%@TrueName[%D]")
Sample output for my "Z" drive (not really one of the one(s) I am interested in):
Code:
"Z:\Itune Movies" "C:\Users\Daniel Mathews\Music\iTunes\iTunes Media\Movies"
"Z:\Movies" "D:\iTunes Movies"
"Z:\Itune Movies\E.T. The Extra-Terrestrial" "C:\Users\Daniel Mathews\Music\iTunes\iTunes Media\Movies\E.T. The Extra-Terrestrial"
"Z:\Itune Movies\E.T. The Extra-Terrestrial - iTunes Extr" "C:\Users\Daniel Mathews\Music\iTunes\iTunes Media\Movies\E.T. The Extra-Terrestrial - iTunes Extr"
"Z:\Itune Movies\Ender's Game" "C:\Users\Daniel Mathews\Music\iTunes\iTunes Media\Movies\Ender's Game"
"Z:\Itune Movies\Ender's Game - iTunes Extras" "C:\Users\Daniel Mathews\Music\iTunes\iTunes Media\Movies\Ender's Game - iTunes Extras"
"Z:\LinkedFrom\LinkedTo" "\LinkedTo"
"Z:\Movies\E.T. The Extra-Terrestrial" "D:\iTunes Movies\E.T. The Extra-Terrestrial"
"Z:\Movies\E.T. The Extra-Terrestrial - iTunes Extr" "D:\iTunes Movies\E.T. The Extra-Terrestrial - iTunes Extr"
"Z:\Movies\Ender's Game" "D:\iTunes Movies\Ender's Game"
"Z:\Movies\Ender's Game - iTunes Extras" "D:\iTunes Movies\Ender's Game - iTunes Extras"
Thank you!
 
Back
Top
[FOX] Ultimate Translator
Translate