Add "find Target" To Your Shortcuts!

Discussion in 'Tutorials' started by Samystic, Dec 14, 2006.

Thread Status:
Not open for further replies.
  1. Samystic

    Samystic FRESH mind

    Joined:
    Oct 7, 2005
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
    Hello users!
    Windows missed out something...something very useful..."Find Target" option directly on the menu of a shortcut... beginners do not find it that useful....advanced users are tired of properties>Find Target...

    Here is the solution:

    1)Copy this code as it is:


    @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



    2)Copy and paste this code in Notepad...yes only Notepad...Wordpad won't do! (Start>Run>Notepad)

    3)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)

    4)Run Find_Target.bat (Just press Enter!)

    A VB Script<Find_Target.vbs> is created...DO NOT TOUCH THAT FILE!

    There you are!!! NOW YOU CAN SCREAM, SHOUT OR RUN LIKE A MADMAN...Shortcuts have their origin(Target)

    Thank you and thank me!

    Happy targeting!:p

    Source : - http://www.jsifaq.com/SF/Tips/Tip.aspx?id=9693
     
    Last edited by a moderator: Dec 15, 2006
  2. sam_1710

    sam_1710 New Member

    Joined:
    May 4, 2006
    Messages:
    751
    Likes Received:
    1
    Trophy Points:
    0
    kewl... thanks !! u deserved a rep for dat!!
     
  3. wizrulz

    wizrulz GUNNING DOWN TEAMS

    Joined:
    Mar 5, 2005
    Messages:
    1,724
    Likes Received:
    21
    Trophy Points:
    0
    Location:
    MUMBAI
    good one dude....

    if thats urs too good...will rep u..

    if not please give source ...
     
  4. Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    @Samystic
    Buddy! u forgot to post the source in hurry :D

    http://www.jsifaq.com/SF/Tips/Tip.aspx?id=9693

    btw Just paste following in notepad and save the file with .REG extension and then run the file: :D

    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\Directory\shell\Find.Target]
    @="&Find Target"
    
    [HKEY_CLASSES_ROOT\Directory\shell\Find.Target\command]
    @="\"explorer.exe\" /select,\"%1\""
    
    [HKEY_CLASSES_ROOT\*\shell]
    
    [HKEY_CLASSES_ROOT\*\shell\Find.Target]
    @="&Find Target"
    
    [HKEY_CLASSES_ROOT\*\shell\Find.Target\command]
    @="\"explorer.exe\" /select,\"%1\""
     
    Last edited: Dec 14, 2006
    Kiran.dks likes this.
  5. Kiran.dks

    Kiran.dks New Member

    Joined:
    Apr 3, 2006
    Messages:
    2,494
    Likes Received:
    91
    Trophy Points:
    0
    Location:
    Pune, India
    Nice work Vishal. Reps for u. Good to see the source.

    @Samystic,
    You should include source while posting such things. Else you may be banned.
     
  6. n2casey

    n2casey Super Hero - Super Powers

    Joined:
    Sep 1, 2006
    Messages:
    766
    Likes Received:
    20
    Trophy Points:
    0
    Location:
    Dynamic
    ^^
    Hey Vishal!

    U have so much answers, just prepare to write a 400-500 pages book. :D :D (Just joking).
    Nice trick, was not knowing that. Thx for that

    @ Samystic

    Thx for that info. Always remember to post the source if the tute is not ur own.
     
  7. anilmail17

    anilmail17 New Member

    Joined:
    Aug 29, 2004
    Messages:
    149
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    127.0.0.1
    vishal i think the code provided by u create find target link for all file and folder because the code uses HKCLR\* and HKCLR\Directory but the Find target should work only for shourtcut soo the code should be like this
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\lnkfile\shell\Find.Target]
    @="&Find Target"
    
    [HKEY_CLASSES_ROOT\lnkfile\shell\Find.Target\command]
    @="\"explorer.exe\" /select,\"%1\""
    
     
  8. Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    Yeah! The code I provided works for all files ;)
     
  9. mehulved

    mehulved 18 Till I Die............

    Joined:
    Jul 15, 2004
    Messages:
    5,790
    Likes Received:
    44
    Trophy Points:
    0
    Location:
    India, Mumbai, Marine Lines
    I have added the source for now. But, if I see this next time, you will get a ban for a week.
     
  10. aditya.shevade

    aditya.shevade Console Junkie

    Joined:
    Jun 29, 2006
    Messages:
    990
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    USA
    @Vishal....

    That only displayes the target of the shortcut file and not the source file.... Is there any was to make the source of the mail file visible?
     
  11. anilmail17

    anilmail17 New Member

    Joined:
    Aug 29, 2004
    Messages:
    149
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    127.0.0.1
    now i realize that the code provided by Samystic is 100% correct and code provided by me was wrong bcz Samystic creates a vbs which requires an argument of shortcut file then that vbscript find the target of shortcut and then open that target using explorer.exe /select %1
     
  12. aditya.shevade

    aditya.shevade Console Junkie

    Joined:
    Jun 29, 2006
    Messages:
    990
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    USA
    Ya... his script works. Can you do that with the registry?
     
  13. Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    ^^
    Code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CLASSES_ROOT\lnkfile\shell\Find.Target]
    @="&Find Target"
    
    [HKEY_CLASSES_ROOT\lnkfile\shell\Find.Target\command]
    @="\"explorer.exe\" /select,\"%1\""
     
  14. aditya.shevade

    aditya.shevade Console Junkie

    Joined:
    Jun 29, 2006
    Messages:
    990
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    USA
    Still no change.... The window that opens up is documents and settings\username\desktop\

    Aditya
     
  15. Vishal Gupta

    Vishal Gupta Microsoft MVP

    Joined:
    Jul 28, 2005
    Messages:
    5,173
    Likes Received:
    121
    Trophy Points:
    0
    Location:
    AskVG.com
    I didnt get it, what u mean?
     
  16. anilmail17

    anilmail17 New Member

    Joined:
    Aug 29, 2004
    Messages:
    149
    Likes Received:
    10
    Trophy Points:
    0
    Location:
    127.0.0.1
    vishal actually this code opens the location at which the shortcut is created and not the location of target file, this is the only reason Samystic used that vbs to fetch the target location from the shortcut file
     
  17. aditya.shevade

    aditya.shevade Console Junkie

    Joined:
    Jun 29, 2006
    Messages:
    990
    Likes Received:
    3
    Trophy Points:
    0
    Location:
    USA
    Ya that is what happens.... What I wanted to say was that, but I have exams on 23rd and right now my head is going to get ripped off.... don't mind.
     
  18. OP
    OP
    Samystic

    Samystic FRESH mind

    Joined:
    Oct 7, 2005
    Messages:
    36
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Mumbai
    Ok guys...nxt time u'll have the source...vishal is right...may be i was in a hurry...:D
     
Thread Status:
Not open for further replies.

Share This Page