|
本帖最后由 hlowld 于 2024-5-11 10:18 编辑
发一个自己写的查看 链接的目标路径 的批处理
::用法示例:showtarget.cmd d:\aa\bb
@ECHO OFF & PUSHD "%~DP0" & setlocal ENABLEDELAYEDEXPANSION
fltmc>nul||mshta vbscript:CreateObject("Shell.Application").ShellExecute("%~dpnx0","%*",,"runas",1)(window.close)&&exit
if %1 == "" (echo Usage: %0 DIRECTORY & goto end)
call :doit %1
goto end
:doit
set "curd=%~1"
set "hz=%~2"
for %%i in ("!curd!") do (
set att=%%~ai
set pard=%%~dpi
set pard=!pard:~0,-1!
set nn=%%~nxi
if "!att:~-3,-2!"=="l" ( call :showtarget "!nn!" "!curd!" "!hz!" & goto :eof)
)
set "curd=!pard!"
set "hz=\!nn!!hz!"
if "!curd:~-1!" ==":" goto :eof
call :doit "!curd!" "!hz!"
goto :eof
:showtarget
cd /d %2/..
for /f "tokens=1-6 delims=<>[]" %%a in ( 'dir /a:l ^| findstr %1') do (
set "dd=%%c"
set "ee= %~1 "
if !ee!==!dd! (
echo "%~2%~3" 的目标路径是:"%%d%~3"
set "ff=%%d%~3"
call :doit "!ff!"
)
)
goto :eof
:end
echo.
pause
exit
用Reg.exe add "HKCR\Directory\shell\查看链接的目标路径\command" /ve /t REG_SZ /d "\"%systemroot%\temp\app\common\showtarget.cmd\" \"%%1\"" /f
在文件夹右键加个菜单更好用
特点是不只可以查看链接本身的目标路径,链接下的子目录也能查看,且支持链接传递(即链接的目标路径也是链接或者其子目录) |
|