Open file's/directory's path from Explorer in TC and highlight it

English support forum

Moderators: sheep, Hacker, Stefan2, white

Post Reply
Notme
Junior Member
Junior Member
Posts: 4
Joined: 2011-06-02, 09:05 UTC

Open file's/directory's path from Explorer in TC and highlight it

Post by *Notme »

Hello!

I'd like to have Total Commander in the Explorer's context menu for both files and directories.
In both cases I'd like to have a menu item which would open the path in TC.
If the context menu was invoked on a file, then that file should be highlighted in TC, e.g. the cursor (not mouse, but the "frame" in TC) should be on that file.
Optimally I'd also be able to specify whether to show the file/dir on the left, or right side (maybe one menu item for each side).

I am aware of the https://www.ghisler.ch/wiki/index.php/Explorer_integration and I've been playing a bit with it, but I've only achieved opening a directory in TC.

Can someone help?
TC 9.22a 64 bit, Win 10 64 bit

User avatar
Horst.Epp
Power Member
Power Member
Posts: 3765
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *Horst.Epp »

The perfect tool for this is
https://totalcmd.net/plugring/tcshell.html
Windows 10 Home x64 May 2020 Update, Version 2004 (OS Build 19041.388)
Intel(R) Core(TM) i7-4770 CPU @ 3.40GH, 16GB RAM
TC 9.51 x64 / x86, Everything 1.4.1.985 (x64)

User avatar
Dalai
Power Member
Power Member
Posts: 7129
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *Dalai »

I'm using something like this:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\TotalCmd]
@="Total Commander (32 bit)"

[HKEY_CLASSES_ROOT\*\shell\TotalCmd\command]
@="\"C:\\Program Files (x86)\\Total Commander\\totalcmd.exe\" /N /A \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\TotalCmd]
@="Total Commander (32 bit)"

[HKEY_CLASSES_ROOT\Directory\shell\TotalCmd\command]
@="\"C:\\Program Files (x86)\\Total Commander\\totalcmd.exe\" /N \"%1\""
This shows TC in the context menu of files and directories, and using the context menu item of a file opens the directory the file is in and sets the cursor onto this file.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups

Notme
Junior Member
Junior Member
Posts: 4
Joined: 2011-06-02, 09:05 UTC

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *Notme »

Thank you for the suggestions. I ended up with:

Code: Select all

[HKEY_CLASSES_ROOT\*\shell\TC open in LEFT panel]

[HKEY_CLASSES_ROOT\*\shell\TC open in LEFT panel\command]
@="c:\\totalcmd\\TOTALCMD64.EXE /O /A /T /L=\"%1\""

[HKEY_CLASSES_ROOT\*\shell\TC open in RIGHT panel]

[HKEY_CLASSES_ROOT\*\shell\TC open in RIGHT panel\command]
@="c:\\totalcmd\\TOTALCMD64.EXE /O /A /T /R=\"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\TC open in LEFT panel]

[HKEY_CLASSES_ROOT\Directory\shell\TC open in LEFT panel\command]
@="c:\\totalcmd\\TOTALCMD64.EXE /O /T /L=\"%1\""

[HKEY_CLASSES_ROOT\Directory\shell\TC open in RIGHT panel]

[HKEY_CLASSES_ROOT\Directory\shell\TC open in RIGHT panel\command]
@="c:\\totalcmd\\TOTALCMD64.EXE /O /T /R=\"%1\""
which is almost exactly what I had in mind.
I've been trying to make these into sub-menus, following this https://docs.microsoft.com/en-us/windows/win32/shell/creating-static-cascading-menus terribly hopeless guide without any luck and so I've decided not to waste more time on that.

However if someone knows how to do it, please share the knowledge.
TC 9.22a 64 bit, Win 10 64 bit

NotNull
Junior Member
Junior Member
Posts: 89
Joined: 2019-11-25, 20:43 UTC
Location: NL

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *NotNull »

Notme wrote:
2020-01-22, 13:57 UTC
However if someone knows how to do it, please share the knowledge.
Although I got that working (years ago and indeed: after a lot of trying), there is a simpler way.
It is converted from something I use and adapted to your situation (but not tested).
This is the context menu for the currently logged on user. If you want it for all users, replace HKCU with HKLM

Code: Select all

Windows Registry Editor Version 5.00

;==========[ SUBMENU ]==========================

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu]
"subcommands"=""
"MUIVerb"="Open in &Total Commander (32 bit)"
"Icon"="\"c:\\totalcmd\\TOTALCMD64.EXE\""

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell]

;==========[ LEFT PANE ]==========================

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Left]
"MUIVerb"=".. in the &LEFT pane"

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Left\Command]
@="\"c:\\totalcmd\\TOTALCMD64.EXE\" /O /A /T /L=\"%1\""


;==========[ RIGHT PANE ]==========================

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Right]
"MUIVerb"=".. in the &RIGHT pane"

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Right\Command]
@="\"c:\\totalcmd\\TOTALCMD64.EXE\" /O /A /T /R=\"%1\""


tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *tony01 »

It doesn't work.
I don't see a context menu when I right-click a dir in Win explorer.
Please fix it and test it, before posting.
Thanks

User avatar
Hacker
Moderator
Moderator
Posts: 11733
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *Hacker »

tony01,
I don't see a context menu when I right-click a dir in Win explorer.
This is very strange. I definitely do.

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.

tony01
Junior Member
Junior Member
Posts: 35
Joined: 2003-09-13, 13:19 UTC

Re: Open file's/directory's path from Explorer in TC and highlight it

Post by *tony01 »

Roman:
I am talking about "NotNull" registry file that he posted, I changed the TC path in my computer, and I added it to the registry, but it does not work.
I don't see a context menu when I right-click a dir in Win explorer. I don't know what is wrong. HELP PLEASE. :roll: :roll:
see below:

Windows Registry Editor Version 5.00

;==========[ SUBMENU ]==========================

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu]
"subcommands"=""
"MUIVerb"="Open in &Total Commander (32 bit)"
"Icon"="\"c:\\Total Commander\\Totalcmd64.exe\""

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell]

;==========[ LEFT PANE ]==========================

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Left]
"MUIVerb"=".. in the &LEFT pane"

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Left\Command]
@="\"c:\\Total Commander\\Totalcmd64.exe\" /O /A /T /L=\"%1\""


;==========[ RIGHT PANE ]==========================

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Right]
"MUIVerb"=".. in the &RIGHT pane"

[HKEY_CURRENT_USER\Software\Classes\*\Shell\TCmenu\Shell\TC.Right\Command]
@="\"c:\\Total Commander\\Totalcmd64.exe\" /O /A /T /R=\"%1\""

Post Reply