Saturday, March 3, 2007

Adding "Find Target" To The Shorcuts

Find Target is not present directly on the menu of a shortcut. This makes the job tough in finding the target of the shortcuts on the desktop. We can fix this with the help of some code and notepad.



Code:

@echo off
setlocal
set FT="%TEMP%\Find_Target.tmp"
set FTV="C:\Find_Target.vbs"
@echo REGEDIT4>%FT%
@echo.>>%FT%
@echo [HKEY_CLASSES_ROOT\lnkfile\Shell\Find Target\command]>>%FT%
@echo @="wscript.exe \"C:\\Find_target.vbs\" \"%%1\"">>%FT%
@echo.>>%FT%
@echo.>>%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%
endlocal

  • Copy and paste this code in Notepad
  • Save this file as Find_Target.bat in the root drive of your OS(directly in the drive where Documents and Settings, Program Files and WINDOWS reside)
  • Run Find_Target.bat (Just press Enter!)
A VB Script is created...DO NOT TOUCH THAT FILE!


No comments:

Post a Comment