There are a number of keys that need to be set in order for this to work.
Create a new key in
HKEY_CLASSES_ROOT
for this file extension string (including the leading dot character) and set its default value to a unique name that you can use to link the two together. This will give the following key and value:
HKEY_CLASSES_ROOT\.ext
Default extfile
Create a subkey
OpenWithList\application.exe
where
application.exe
is the name of the application that will handle files with this extension. You now have the key:
HKEY_CLASSES_ROOT\.ext\OpenWithList\application.exe
Create a key with the same name as the default value in the
HKEY_CLASSES_ROOT\.ext
key and set
its default value to the unadorned name of the application as used in
OpenWithList\application.exe
, giving the key and value:
HKEY_CLASSES_ROOT\extfile
Default application file
Add a subkey to the Applications key in
HKEY_CLASSES_ROOT
as follows, and set its default value to the full path of your application followed by a placeholder for the filename when you click on it, thus:
HKEY_CLASSES_ROOT\Applications\application.exe\shell\open\command
Default C:\Program Files\Utilities\application.exe %1
Add a similar subkey to the
extfile
key thus:
HKEY_CLASSES_ROOT\extfile\shell\open\command
Default C:\Program Files\Utilities\application.exe %1
Note how the extension, the "extension type" name and the program name are linked in order for this to work.