VBS版
@echo off
echo Set OS = GetObject("winmgmts:")>%windir%\czmd.vbs
echo Set CF = OS.ExecQuery("Select * From Win32_ShortcutFile WHERE Name = '" ^& Replace(WScript.Arguments(0),"\","\\") ^& "'")>>%windir%\czmd.vbs
echo Set WS = WScript.CreateObject("WScript.Shell")>>%windir%\czmd.vbs
echo For Each objFile in CF>>%windir%\czmd.vbs
echo WS.Run ("explorer /select," ^& objFile.Target)>>%windir%\czmd.vbs
echo Next>>%windir%\czmd.vbs
REG ADD HKCR\lnkfile\shell\查找目标\command /ve /d "C:\WINDOWS\system32\WScript.exe c:\windows\czmb.vbs %%1" /f
命令版:
@echo off
reg add HKCR\lnkfile\shell\定位文件\command /f /ve /d "cmd /cfor /f \"delims=\" %%%%i in ('find \":\" \"%%1\"^|findstr \"^^:\"') do explorer /select,/n,\"%%~fi\"