1

In Windows 7, is it possible to have different file extensions with unique description names, but all the same actions, without duplicating all the actions (for each extension) in the Windows registry?

As a simple contrived example, have these file extensions and descriptions:

File extension: .txt 
Description: "Text File"

File extension: .no
Description: "No Way"

File extension: .yes
Description: "Absolutely"

By "Description", I'm referring to the description that Windows displays in the Type column in Windows Explorer & native open/save dialog boxes.

With all three extensions having identical open, edit, print, printtto, et. al. context menu commands (actions).

This is trivial to accomplish if you are okay with all the descriptive names being the same for all the extensions, but that is not what I want.

I'm fine manually editing the Windows registry to get this accomplished.

Note that I would prefer to avoid "User Choice" overrides, but if that's a requirement to get this done, so be it.

2 Answers 2

1

Create the file type at HKLM\SOFTWARE\Classes\my_yes_file normally, then create the shell subkey as a symbolic link pointing to \MACHINE\SOFTWARE\Classes\txtfile\shell.

Windows supports symlinks in the Registry through the API but the standard tools cannot create them; you'll need third-party software (as described in this blog post).

Searching GitHub found CreateRegSymlink.ps1 (a C# program pretending to be a PowerShell script) and mkreglink.

4
  • 1
    I hate this solution but I bet that it is the only way to possibly do what he is asking for. Commented Aug 20, 2021 at 16:34
  • Symlinks in the registry? Such power I didn't know was available! Is this how the default aliased registry hives work? Commented Aug 20, 2021 at 16:55
  • 1
    @RockPaperLz: It seems that HKCU and HKCR aren't done through symlinking, they (and the rest of HKEY_*) work as a whole different layer of illusion, probably similar in concept to how "drive letters" are done. On the other hand, some keys such as CurrentControlSet (mentioned in the linked blog post) do use symlinks; RegExp shows a few more. Commented Aug 20, 2021 at 17:12
  • Thanks for the details and also the link to RegExp. Are you the author by any chance? Either way, you may like this tool as well: registry-finder.com Commented Aug 20, 2021 at 23:15
0

You can specify the actions once and use them for multiple extensions, each extension keeping its own other settings.

You would give this common action a name and store the data under that name:

HKEY_CLASSES_ROOT
-- myname
---- open
------ command
---- print
------ command

Your extensions will use myname this way:

HKEY_CLASSES_ROOT
-- .txt
---- (Default) is myname
-- .no
---- (Default) is myname

Each extension can have its own other data.

7
  • This won't do what he is asking for as the descriptions are stored in the target of .ext -> default and not under .ext itself. He is asking how to have unique descriptions for each extension without duplicating the target action (like txtfile). Commented Aug 20, 2021 at 15:44
  • @SeñorCMasMas: He is asking to duplicate the actions, just not the rest of it: "With all three extensions having identical open, edit, print, printtto, et. al. context menu commands (actions)."
    – harrymc
    Commented Aug 20, 2021 at 15:53
  • Harry, you are correct that I do want to duplicate the actions... but where would I put the unique description names for each extension ("Text File", "No Way", and "Absolutely" in the example)? Commented Aug 20, 2021 at 16:53
  • Anywhere you like - create a new reg_sz item below .txt etc, call it for example Description, and set its value. It would have no meaning for Windows and so won't bother anything.
    – harrymc
    Commented Aug 20, 2021 at 17:42
  • Thanks. I'm referring to the actual description that Windows displays in the Type column in Windows Explorer & native open/save dialog boxes. That's what I would like to be unique for each extension, but with the actions shared amongst a large group of extensions. Commented Aug 20, 2021 at 23:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .