JSI Tip 9693. How can I add a 'Find Target' option to a shortcut's context menu?

With information provided by Daniel Martín, I have scripted Find_Target.bat to add a Find Target option when you right-click a shortcut.

To add a Find Target option, an administrator would run Find_Target on the computer.

Find_Target.bat contains:

@echo off
set FT="%TEMP%\Find_Target.tmp"
set FTV="C:\Find_Target.vbs"
@echo REGEDIT4>%FT%
@echo \[HKEY_CLASSES_ROOT\lnkfile\Shell\Find Target\command\]>>%FT%
@echo @="wscript.exe \"C:\\Find_target.vbs\" \"%%1\"">>%FT%
@echo Dim param, filenam, targt, shortct>%FTV%
@echo Set param = WScript.Arguments>>%FTV%
@echo filenam = param (0)>>%FTV%
@echo Set WshShell = WScript.CreateObject("WScript.Shell")>>%FTV%
@echo Set shortct = WshShell.CreateShortcut(filenam)>>%FTV%
@echo targt = shortct.TargetPath>>%FTV%
@echo WshShell.Run "%windir%\explorer.exe /select," ^& Chr(34) ^& targt ^& Chr(34)>>%FTV%
regedit /s %FT%
del /q %FT%

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.