Page 1 of 1

"Associate with" fails to show filetypes with no "open" command

Posted: 2020-10-02, 17:23 UTC
by M95D
"Associate with..." dialog fails to show filetypes that have no "open" command defined.
To reproduce the bug, create a new file association like this:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.php]
@="PHP4"

[HKEY_CLASSES_ROOT\.php4]
@="PHP4"

[HKEY_CLASSES_ROOT\PHP4]
@="PHP4 Script"

[HKEY_CLASSES_ROOT\PHP4\Shell]
@="run"

[HKEY_CLASSES_ROOT\PHP4\Shell\edit]
@="&Edit"

[HKEY_CLASSES_ROOT\PHP4\Shell\edit\command]
@="notepad.exe \"%1\""

[HKEY_CLASSES_ROOT\PHP4\Shell\run]
@="&Run"

[HKEY_CLASSES_ROOT\PHP4\Shell\run\command]
@="php.exe \"%1\""
In the example above, PHP files have two commands: Edit and Run. Run is the default. There is no Open.
Select a .php file in Total Commander and open "Associate with...". File will appear as not associated with any program. "PHP Script" will not appear in the list.

Now add this:

Code: Select all

[HKEY_CLASSES_ROOT\PHP4\Shell\open]
@="&Open"

[HKEY_CLASSES_ROOT\PHP4\Shell\open\command]
@="notepad.exe \"%1\""
Now open again the Associate dialog. PHP files will appear associated with "PHP Script".

Re: "Associate with" fails to show filetypes with no "open" command

Posted: 2020-10-03, 02:06 UTC
by petermad
I think it is highly irregular to have a \Shell\run\command - I searched my Windows 7 Pro registry and only found one:
HKEY_CLASSES_ROOT\SDRun.AutoPlayHandler\shell\run\command

And in my Window 10 Home registry I didn't find any.

Re: "Associate with" fails to show filetypes with no "open" command

Posted: 2020-10-03, 10:48 UTC
by sqa_wizard
I think it is highly irregular to have a \Shell\run\command
I agree.
But at least the "Edit" verb should be taken in account for association.

Re: "Associate with" fails to show filetypes with no "open" command

Posted: 2020-10-03, 12:43 UTC
by Horst.Epp
sqa_wizard wrote: 2020-10-03, 10:48 UTC
I think it is highly irregular to have a \Shell\run\command
I agree.
But at least the "Edit" verb should be taken in account for association.
The Edit verb is not for opening, why should it be taken.
There is a default logic for opening end editing which is followed by TC.
So where is the need for any change here ?

Re: "Associate with" fails to show filetypes with no "open" command

Posted: 2020-10-03, 16:52 UTC
by M95D
Run and Execute were just some examples. To me, "Open" on a script is ambiguous. English is not my native language. Maybe it's not ambiguous to you.

Yes, it is a bit unusual for a file not to have Open. On my system I found these:
- the PHP associations I created
- the Python associations I created
- .ax, .dll, .ocx (only Register and Unregister, created by a system-tweak program I use)
- .cpl => cplfile (only cplopen and runas)
- .odc => ODCFile (only Analyze and Edit)
- a few image types => PBrush (only Edit, Print and PrintTo)
- .pfx => PFXFile (only Add)
- .rnk => rnkfile (only Connect, Disconnect and Edit Connection Properties)
- a few VirtualPC HDD files => Virtual HDD (only Mount, UnMount, etc.)
- .wdp => wdpfile (only Print, PrintTo)
- AudioCD, DVD (only Play, but these are not actual files)
- Directory, Drive (only Find, but these are not files)

The problem is that file association is not listed if there is no Open command. The file might be associated with something, and start something on a doubleclick/enter, but appear as not associated.