Say that I set up a symbolic link:
mklink /D C:\\root\\Public\\mytextfile.txt C:\\root\\Public\\myothertextfile.txt
Editor\'s note: O
all credits to @SecurityAndPrivacyGuru , [cmd]
complete batch script/function that reads symlink{|s in folder} and outputs list with them and their target paths
@echo off
setlocal enableExtensions enableDelayedExpansion
cd /D "%~dp0"
set br=^
rem br;
set "pafIf=<>"
set "gIfZsymLink="
for /f "tokens=*" %%q in ('dir "!pafIf!" /al /b') do (
for /f "tokens=2 delims=[]" %%r in ('dir /al ^| findstr /i /c:"%%q"') do (
set "gIfZsymLink=!gIfZsymLink!%%~fq>%%r!br!"
)
)
set "gIfZsymLink=!gIfZsymLink:~0,-1!"
rem echo "!gIfZsymLink!"
for /f "tokens=1,2 delims=>" %%q in ("!gIfZsymLink!") do (
echo symlink: %%q , filepath: %%r
)
:scIn
rem endlocal
pause
rem exit /b