Can't invoke custom verb on multiple files

Found a bug in "Everything"? report it here
Post Reply
Psyche
Posts: 4
Joined: Wed Aug 26, 2020 9:27 am

Can't invoke custom verb on multiple files

Post by Psyche »

I define a custom verb in the windows registry, named dump, like this:

Code: Select all

[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.fooext\shell\Dump]
@="Dump"
[HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.fooext\shell\Dump\command]
@="C:\\some path\\dump something.exe %1"
And put

Code: Select all

custom_verb02=Dump
in Everything.ini.

It works in the windows explorer, both on a single file and multiple files.
But it only works in everything on a single file, if I select multiple files in everything and click the right mouse, the dump verb doesn't show in the context menu (it does in the single file context menu), and keyboard short cut for that custom verb also take no effect. The multiple files I selected have the same extension name, .fooext for the above case.

I'm using the latest stable version of everything: V1.4.1.988 (x64). My os is Windows 10 2004.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Can't invoke custom verb on multiple files

Post by NotNull »

Confirmed.
Everything uses it's own routine to enumerate the context menu entries. This one probably slipped through (I guess; not the developer).
I always assumed that you could not define System level file associations on a user level like this. Thanks for this wisdom!


What *does* work is the "normal" way to define verbs on a user level.
Using this, you can select multiple .fooext files and select Dump.

Code: Select all

[HKEY_CURRENT_USER\Software\Classes\.fooext\shell\Dump]
@="Dump"

[HKEY_CURRENT_USER\Software\Classes\.fooext\shell\Dump\command]
@="\"C:\\some path\\dump something.exe\" \"%1\""
Notice the \"quoting\"
BTW: some programs require %1 instead of \"%1\"
Psyche
Posts: 4
Joined: Wed Aug 26, 2020 9:27 am

Re: Can't invoke custom verb on multiple files

Post by Psyche »

Thanks for your advice.
I tried to put the above shell registry items under "HKEY_CURRENT_USER\Software\Classes\.fooext", but the dump verb won't appear in the context menu if I delete the items under "HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations\.fooext", I don't know why.
void
Developer
Posts: 16753
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can't invoke custom verb on multiple files

Post by void »

Thanks for the bug report.

I'll look into supporting HKEY_CURRENT_USER\Software\Classes\...

Currently Everything only supports custom verbs defined in the base class under HKEY_CLASSES_ROOT.

For example, the extension .txt is defined under
HKEY_CLASSES_ROOT\.txt

The (Default) value will specify the base class. This is usually txtfile for .txt files.

The txtfile base class is defined under
HKEY_CLASSES_ROOT\txtfile

This is where you can add your custom verbs, for example:
HKEY_CLASSES_ROOT\txtfile\shell\dump
froggie
Posts: 301
Joined: Wed Jun 12, 2013 10:43 pm

Re: Can't invoke custom verb on multiple files

Post by froggie »

@void -

According to this https://docs.microsoft.com/en-us/window ... s-root-key Microsoft document, HKEY_CLASSES_ROOT is a merged view that shows keys from HKEY_CURRENT_USER.
void
Developer
Posts: 16753
Joined: Fri Oct 16, 2009 11:31 pm

Re: Can't invoke custom verb on multiple files

Post by void »

Thanks for the HKEY_CLASSES_ROOT Key link.
I need to look into it more.

I'm using IQueryAssociations to get the class (.txt) and baseclass (txtfile).

IQueryAssociations seems to ignore HKEY_CURRENT_USER\Software\Classes\SystemFileAssociations
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Can't invoke custom verb on multiple files

Post by NotNull »

void wrote: Fri Aug 28, 2020 7:31 am Thanks for the HKEY_CLASSES_ROOT Key link.
I need to look into it more.
My 2 cents:
HKEY_CLASSES_ROOT is a virtual registry key. It is the entries from HKLM\Software\Classes superimposed with the keys from HKCU\Software\Classes.
As a developer you should read the keys from HKCR instead of the ones from HKLM and HKCU.
void wrote: Thu Aug 27, 2020 3:12 am The (Default) value will specify the base class.
In older versions of Windows, you didn't need to define the keys under a base class (or ProgID or AppID; whatever the are called officially). You could define them under .txt too.
Thanks to backwards compatibility of Windows, that still works.


@Psyche: Let's try to fix your issue.
First of all, I am assuming you are running a 64-bit version of Everything as the keys you mentioned are put in the 64-bit part of the registry. If not: let me know for a "Plan B" strategy (although I would recommend using 64-bit Everything on a 64-bit Windows)
If you are indeed running 64-bit Everything, let's try it with a clean file extension: .barext
  • Save these 2 CMD script in an empty folder
  • Run barext_ON.cmd
    It generates the necessary regkeys adn also 3 .barext files.
  • Select the 3 .barext files
  • When you right-click these files, you should see a "void" entry. Select it
    All 3 .barext files should now be opened in Notepad.
  • Report back your results.
  • When done, run barext_OFF.cmd

barext_ON.cmd

Code: Select all

@echo off
setlocal

reg add "HKCU\Software\Classes\.barext\shell\void\command" /ve /d "\"%WINDIR%\notepad.exe\" \"%%1\"" /f

echo First file>  "%~dp0\First.barext"
echo Second file> "%~dp0\Second.barext"
echo Third file>  "%~dp0\Third.barext"

pause

barext_OFF.cmd

Code: Select all

@echo off
reg delete "HKCU\Software\Classes\.barext" /f
pause
Psyche
Posts: 4
Joined: Wed Aug 26, 2020 9:27 am

Re: Can't invoke custom verb on multiple files

Post by Psyche »

@NotNull
I tried your script, works as expected, both in Windows Explorer and Everything.
So this means there's some wrong with the .fooext extension.
Psyche
Posts: 4
Joined: Wed Aug 26, 2020 9:27 am

Re: Can't invoke custom verb on multiple files

Post by Psyche »

Thanks for your help.
This may be complicated, don't worry about it, anyway I can use the SendTo menu instead.
NotNull
Posts: 5461
Joined: Wed May 24, 2017 9:22 pm

Re: Can't invoke custom verb on multiple files

Post by NotNull »

I don't have a problem with complicated :)

If you want some help solving this, let me know (but maybe better through PM as this investigation will not be very interesting for the rest of the forum)
Post Reply