Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Add 'Find Target' to Right Click...

- - - - -

  • Please log in to reply
37 replies to this topic

#26
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
@dubbin
Nice,
but not quite, if its a link on the desktop then it simply open's desktop and shows the Target which points nowhere intended

Edited by maxXPsoft, 27 October 2005 - 10:07 PM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1


How to remove advertisement from MSFN

#27
kaya

kaya

    Newbie

  • Member
  • 18 posts
  • Joined 01-February 04

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\lnkfile\Shell\Find Target\command]@="\"explorer.exe\" /select,\"%1\""


When you click on a shortcut in "Quick Launch", it opens Quick Launch folder, not the shortcut's target folder.

#28
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,577 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

As nobody has picked up on it yet, from my vbs alternative earlier, here is a working method!

First create this file and save it as %SystemRoot%\system32\GeTarget.vbs

Wscript.Echo CreateObject("WScript.Shell").CreateShortcut(WScript.Arguments (0)).TargetPath
The above should all be on one line.

Now paste this single line into Start » Run and click OK

reg add "HKCU\Software\Classes\lnkfile\Shell\Find Target\command" /ve /d "%comspec% /c @echo off&for /f \"delims=\" %%? in ('cscript //nologo %SystemRoot%\system32\GeTarget.vbs \"%1\"') do start \"\" explorer.exe /select, \"%%~?\"" /f
Now right click any shortcut and choose Find Target

I hope this is better!

#29
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag

As nobody has picked up on it yet, from my vbs alternative earlier, here is a working method!
I hope this is better!

Don't work here, I see a cmd flash and nothing
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#30
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,577 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

I have it running flawlessly on my machines.

What is the string in your registry value data?

This is mine

C:\WINDOWS\system32\cmd.exe /c @echo off&for /f "delims=" %%? in ('cscript //nologo C:\WINDOWS\system32\GeTarget.vbs "%1"') do start "" explorer.exe /select, "%%~?"

Edited by Yzöwl, 10 November 2005 - 02:01 AM.


#31
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
C:\WINDOWS\system32\cmd.exe /c @echo off&for /f "delims=" %? in ('cscript //nologo C:\WINDOWS\system32\GeTarget.vbs ""') do start "" explorer.exe /select, "%~?"

I see it now from yours and wonder how that happen, I'm missing the double %% in two places. I copied your stuff and pasted in a cmd file instead of run. The double %% is in the cmd file. Strange

Wanted it in a cmd file for my Unattends
Works when I set it like yours manually. Maybe I better export that reg instead of cmd

Edited by maxXPsoft, 10 November 2005 - 08:15 AM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#32
Ed999

Ed999
  • Member
  • 7 posts
  • Joined 07-October 06
The solution to this problem is probably to go to START > RUN and type:

regsvr32 /i shell32.dll

#33
danp129

danp129
  • Member
  • 1 posts
  • Joined 23-March 07
Here's a script I made for this.

 
'Filename:		FindTarget.vbs
'Description: Simulates 'Find Target' button in shortcut properties dialog.
'Created by: Danp129
'@yahoo.com
'Usage: Double click FindTarget.vbs and click 'Yes' to register file.
' Right click a shortcut and click 'Find Target'

' If previous 'Find Target' context menu exists it can backup old
' setting to backup.txt in same path this file is executed from.

option explicit
Dim objShell, sAppPath, ret, sNewRegVal
Const ForAppending = 8

Set objShell = CreateObject("WScript.Shell")

sNewRegVal = "cscript /nologo """ & Wscript.ScriptFullName & """ ""%1"""
sAppPath = Mid(Wscript.ScriptFullName, 1, InStrRev(Wscript.ScriptFullName, "\") - 1)

if WScript.Arguments.count > 0 then
'Script was called from context menu

call FindTarget
else
'Script was not sent arguments, was likely double clicked on
if sNewRegVal<>GetCurRegVal or isnull(GetCurRegVal) then
'Ask user if they wish to add Find Target context menu
ret=msgbox("Register this file as your 'Find Target' handler?", vbYesNo, "Add 'Find Target' context menu?")
if ret=vbYes then
'Call sub to create context menu using this file to handle requests
call CreateContextMenu
end if
else
msgbox "This file is already registered to handle 'Find Target' context menu." & vbcrlf & _
vbcrlf & "To use, simply right-click a shortcut and click 'Find Target'.", vbOKOnly, "Incorrect use"
end if
end if

Set objShell = nothing


Sub FindTarget()
Dim sMainFile, sCmd, sArgs, sPath, arArgOverride, sArgOverride, i, fso, arTmp, sTmp

'Specify lower-case exe files to check if an argument exists
' and should attempt to browse to the argument if it's a
' valid path instead of executable
'Use pipe "|" to seperate files
' e.g. ("notepad.exe|anotherapp.exe")
arArgOverride=split("notepad.exe")

'Shell command for explorer.exe
sCmd = "explorer.exe /select,"

'Main file the link refers to e.g. notepad.exe in 'c:\windows\notepad.exe c:\file.txt'
sMainFile=lcase(CreateObject("WScript.Shell").CreateShortcut(WScript.Arguments(0)).TargetPath)

'Additional arguments in link e.g. c:\file.txt in 'notepad.exe c:\arg.txt'
sArgs=CreateObject("WScript.Shell").CreateShortcut(WScript.Arguments(0)).Arguments

'Check to see if we should browse to arg if specified, if so set blnUseArg to true
if sArgs <> "" then

'get filename only
arTmp=split(smainfile, "\")
sTmp=arTmp(ubound(arTmp))

'Search override filenames for a match
for i = 0 to ubound(arArgOverride)
if sTmp=arArgOverride(i) then
'Create FSO object
Set fso = CreateObject("Scripting.FileSystemObject")

'Remove quotes and leading spaces from args or fso.FileExists will fail
sArgs=trim(replace(sArgs, """", ""))

'See if args is a valid path
if fso.FileExists(sArgs) or fso.FolderExists(sArgs) then
'Use args for path
sPath=sArgs
end if
exit for
end if
next 'iArgO

'Use main file if args was not a valid path
if sPath="" then sPath=sMainFile
else
'No arguments in the shortcut.. Use main file for path
sPath=sMainFile
end if

'Have Explorer open folder containing path
objShell.Run sCmd & sPath

set fso=nothing
end sub

sub CreateContextMenu()

Dim sRegKey, fso, sBackupFile, oTextFile
sBackupFile=sAppPath & "\" & "backup.txt"

sRegKey = GetCurRegVal
if not isnull(sRegKey) then
'Add some prompts to backup current value
if sRegKey<>sNewRegVal and sRegKey<>"" then
ret=msgbox("'Find Target' context menu already exists, would you like to backup the current setting before making changes?", vbYesNoCancel, "Backup current settings?")
if ret=vbCancel then exit sub
if ret=vbYes then
'Save current value to text file, append if backup already exists.
Set fso = CreateObject("Scripting.FileSystemObject")
set oTextFile = fso.OpenTextFile(sBackupFile, ForAppending, true)

oTextFile.Writeline sRegKey
oTextFile.Close
set fso=nothing
set oTextFile=nothing
end if
end if
end if

'Write to registry
objShell.RegWrite "HKCU\Software\Classes\lnkfile\Shell\Find Target\command\", sNewRegVal, "REG_SZ"
end sub

function GetCurRegVal
on error resume next
GetCurRegVal=objShell.RegRead("HKCU\Software\Classes\lnkfile\Shell\Find Target\command\")
if err.number <> 0 then
GetCurRegVal=null
end if
on error goto 0
end function


#34
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,577 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

Looks like a good idea, I'm not in a position to try it at present however.

Nice first post by the way.

#35
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
I've found the 100% cure with a simple reg tweak constructed exactly like it needs to be with no dll.
I'll not disclose it now since its part of my new tweaking program soon to release.

If Oh_Kay still interested then msg me so you can beta the tweak

Edited by maxXPsoft, 04 January 2008 - 04:53 PM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#36
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
Windows Registry Editor Version 5.00
;Note for the Find Target to work you need a default Open unknown files.
;This adds Open w/Notepad if you don't already have something set. Comment out if you do.

[HKEY_CLASSES_ROOT\*\shell\open]
@="Open w/Notepad"

[HKEY_CLASSES_ROOT\*\shell\open\command]
@="notepad.exe \"%1\""

[HKEY_CLASSES_ROOT\*\shell\Find Target...\command]
@="explorer.exe /select, \"%1\""

Vista has 'Open file location' on its right click.

Edited by maxXPsoft, 14 February 2009 - 03:51 PM.

Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1

#37
Oh_Kay

Oh_Kay

    TechnoBabe

  • Member
  • Pip
  • 91 posts
  • Joined 03-October 03
Sorry I missed your post and offer to beta your code MaxXPsoft, for some reason I didn't get a notification of a reply to this thread...

Well here we are again... another reinstall, looking to add the same feature back that started this thread in the first place, and goole brought me right here!

Your updated version is much better now that no dll is required !

It shall have pride of place on my next unattended...

Thanks to everyone that responded to my original question, and especially to you maxXPsoft, nice to see your still around too ;)

#38
maxXPsoft

maxXPsoft

    MSFN Master

  • Developer
  • 2,889 posts
  • Joined 14-November 03
  • OS:Windows 7 x64
  • Country: Country Flag
Oh_Kay :hello:

took me 4 years about :wacko: cause I wanted that also, glad they added to Vista

yes still ticking, messing with Win Seven beta now
Download ++> Windows 7 + 8 Unattended DVD + App Installer + Services Disabler + Load All Button + XML Creator
Jump2Reg - Registry: - Oct 4, 2013 - Version 3.0.4 - 98, ME, NT, 2K, XP, VISTA, Seven, Windows 8+ and 32 or 64 bit

XP Unattended CD/DVD creator - Version 4.1.7
Sample xml + Setupcomplete + Add Right click .wim Windows 7 or Windows 8/8.1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users