To find the target folder of a Program, we usually right click on that program shortcut and say properties > find target.
1. Paste the following code in notepad, give it a name and save the extension as .bat anywhere:
cmdow.exe @ /hid @echo off setlocal set FT=”%TEMP%Find_Target.tmp” set FTV=”C :WINDOWSsystem32Find_Target.vbs” @echo REGEDIT4>%FT% @echo.>>%FT% @echo [HKEY_CLASSES_ROOTlnkfileShellFind Targetcommand]>>%FT% @echo @=”wscript .exe “C:WINDOWSsystem32Find_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 target.reg del /q %FT% endlocal
When executing this .bat code above, it will be inside the C:Windowssystem32 folder Create a vbs named Find_Target.vbs r , if you somehow don’t have this, paste the following into notepad and put it in C:Windowssystem32 as Find_target.vbs
Dim param, filenam, targt, shortct Set param = WScript.Arguments filenam = param (0) Set WshShell = WScript.CreateObject(“WScript.Shell”) Set shortct = WshShell.CreateShortcut(filenam) targt = shortct.TargetPath WshShell.Run “C:Windowsexplorer.exe /select,” & Chr(34) & targt & Chr (34)
This is the main thing and the registry entry that provides the right-click find target that we will use shortly.
2. run the following registry entry:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTlnkfileShellFind Targetcommand] @=”wscript.exe “C:\WINDOWS\system32\Find_target.vbs” “%1″”
now we have an Option to find target with right click
Mendenn