How to divert "open in folder" and "open containing folder" within TC correctly?

English support forum

Moderators: white, Hacker, petermad, Stefan2

avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

Hi!

So this has been a long issue that came up again wit a windows reinstall. There was a working solution for the second: opening the containing folder of a file in TC.
But I couldn't find one for the former, "opening a file within a folder" within TC. Which basically means opening the folder and selecting the file.

Opening the folder worked as expected, but when programs wanted to open a folder and select a file or files TC would still only open a folder. And after some timeout and explorer window would open as well showing the folder with the selected files. Meanwhile the program initiating this might have a frozen UI.

My only conclusion is that TC fails to handle it when the registry is set up this way. And after some timeout an explorer window is opened as a fallback.

So how can I get TC to correctly handle both cases?

Apps to verify with:
  • foobar2000 - when using the "Open Containing Folder" context menu for playlist items.
  • Potplayer - "Open Folder..." main window context menu item.
Windows 10
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *ghisler(Author) »

When you start TC with parameter /A and a file name, it will open the directory of that file now, e.g.
totalcmd64.exe /A /O c:\path\file.ext
will open c:\path and place the cursor on file.ext.
Author of Total Commander
https://www.ghisler.com
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

ghisler(Author) wrote: 2022-11-22, 15:45 UTC When you start TC with parameter /A and a file name, it will open the directory of that file now, e.g.
totalcmd64.exe /A /O c:\path\file.ext
will open c:\path and place the cursor on file.ext.
Thanks, so something like this should work on win10?

Code: Select all

Windows Registry Editor Version 5.00
 
 [HKEY_CLASSES_ROOT\Drive\shell]
 @="open"
 
 [HKEY_CLASSES_ROOT\Drive\shell\open]
 
 [HKEY_CLASSES_ROOT\Drive\shell\open\command]
 @="c:\\totalcmd\\TOTALCMD64.EXE /O /T"%1""
 
 [HKEY_CLASSES_ROOT\Directory\shell]
 @="open"
 
 [HKEY_CLASSES_ROOT\Directory\shell\open]
 
 [HKEY_CLASSES_ROOT\Directory\shell\open\command]
 @="c:\\totalcmd\\TOTALCMD64.EXE /O / T"%1""
 
Windows 10
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *Horst.Epp »

No there 2 small errors
in /T"%1" there is a missing space, should be /T "%1"
in / T"%1"" there is a space to much and a missing space, should be /T %1
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

Horst.Epp wrote: 2022-11-22, 16:21 UTC No there 2 small errors
in /T"%1" there is a missing space, should be /T "%1"
in / T"%1"" there is a space to much and a missing space, should be /T %1
Thanks.
What will happen if I select multiple files in foobar2000 for example and choose "open containing folder". Currently an explorer window opens and all files in question are selected.
Windows 10
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

Hmm. I'm getting a big fat error now:
"This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page."
Windows 10
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *Horst.Epp »

This is my version which worked from Windows 7 up to Windows 11 today.
[
code]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Drive\shell]
@="open"

[HKEY_CLASSES_ROOT\Drive\shell\open]

[HKEY_CLASSES_ROOT\Drive\shell\open\command]
@="c:\\tools\\wincmd\\TOTALCMD64.EXE /O \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell]
@="open"

[HKEY_CLASSES_ROOT\Directory\shell\open]

[HKEY_CLASSES_ROOT\Directory\shell\open\command]
@="c:\\tools\\wincmd\\TOTALCMD64.EXE /O \"%1\""

[/code]
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

Huh. So you need to backslash the quote. I'll try it.
Windows 10
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

ghisler(Author) wrote: 2022-11-22, 15:45 UTC When you start TC with parameter /A and a file name, it will open the directory of that file now, e.g.
totalcmd64.exe /A /O c:\path\file.ext
will open c:\path and place the cursor on file.ext.
I added the /A as well, but it doesn't appear to be the case. The folder is opened but the cursor remains in the default position. This does not work at all.
What do you mean by "now" precisely? I made sure I have the latest (v10.52) TC version.

Also, the explorer window still pops up after some timeout when I use "Open Folder..." in Potplayer. Nothing seems to be different.
Windows 10
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *ghisler(Author) »

2avada
How does your open command look like?
Author of Total Commander
https://www.ghisler.com
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *Horst.Epp »

avada wrote: 2022-11-23, 17:09 UTC
ghisler(Author) wrote: 2022-11-22, 15:45 UTC When you start TC with parameter /A and a file name, it will open the directory of that file now, e.g.
totalcmd64.exe /A /O c:\path\file.ext
will open c:\path and place the cursor on file.ext.
I added the /A as well, but it doesn't appear to be the case. The folder is opened but the cursor remains in the default position. This does not work at all.
What do you mean by "now" precisely? I made sure I have the latest (v10.52) TC version.

Also, the explorer window still pops up after some timeout when I use "Open Folder..." in Potplayer. Nothing seems to be different.
If the Potplayer uses hardcoded Explorer call noting will help.
Only tools which are using the open folder API of Windows will use TC.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

ghisler(Author) wrote: 2022-11-25, 15:19 UTC 2avada
How does your open command look like?
I used this .reg:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Drive\shell]
@="open"

[HKEY_CLASSES_ROOT\Drive\shell\open]

[HKEY_CLASSES_ROOT\Drive\shell\open\command]
@="c:\\totalcmd\\TOTALCMD64.EXE /A /O /T \"%1\""

[HKEY_CLASSES_ROOT\Directory\shell]
@="open"

[HKEY_CLASSES_ROOT\Directory\shell\open]

[HKEY_CLASSES_ROOT\Directory\shell\open\command]
@="c:\\totalcmd\\TOTALCMD64.EXE /A /O /T \"%1\""
Windows 10
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

Horst.Epp wrote: 2022-11-25, 16:06 UTC
avada wrote: 2022-11-23, 17:09 UTC
ghisler(Author) wrote: 2022-11-22, 15:45 UTC When you start TC with parameter /A and a file name, it will open the directory of that file now, e.g.
totalcmd64.exe /A /O c:\path\file.ext
will open c:\path and place the cursor on file.ext.
I added the /A as well, but it doesn't appear to be the case. The folder is opened but the cursor remains in the default position. This does not work at all.
What do you mean by "now" precisely? I made sure I have the latest (v10.52) TC version.

Also, the explorer window still pops up after some timeout when I use "Open Folder..." in Potplayer. Nothing seems to be different.
If the Potplayer uses hardcoded Explorer call noting will help.
Only tools which are using the open folder API of Windows will use TC.
There's no way for me to tell. Do you have any ideas?
But even so the first part still fails on TC's side since the file in folder is not selected.
Windows 10
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *Fla$her »

2avada
Potplayer and foobar2000 open explorer not at the expense of the registry, there is an internal opening mechanism. The registry would not allow you to select multiple files.
Overquoting is evil! 👎
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to divert "open in folder" and "open containing folder" within TC correctly?

Post by *avada »

Fla$her wrote: 2022-11-27, 17:58 UTC 2avada
Potplayer and foobar2000 open explorer not at the expense of the registry, there is an internal opening mechanism. The registry would not allow you to select multiple files.
Not sure how that works. Since changing the registry keys above results in the folders being opened in Total commander. Do they read the registry keys?

Can you name a common app for example that would open successfully open a folder in TC with the file in question selected? For verification.
No apps I ever tried with succeeded at that.
Windows 10
Post Reply