How to associate a file extension to a program without making it the default program How to associate a file extension to a program without making it the default program windows windows

How to associate a file extension to a program without making it the default program


Setting the following keys worked for me:

key HKLM/SOFTWARE/Microsoft/Windows/CurrentVersion/App Paths/<progname>: "" = <appPath>key HKCR/Applications/<progname>/SupportedTypes: <fileExt> = ""key HKCR/<fileExt>: "" = <progID>key HKCR/<progID>/OpenWithList/<progName>key HKCR/<fileExt>/OpenWithList/<progName>key HKCR/SystemFileAssociations/<fileExt>/OpenWithList/<progName>delete key and subkey at HKCU/SOFTWARE/Microsoft/Windows/CurrentVersion/Explorer/fileExts/<fileExt>


You can add scripts to the context menu (below Open with) by adding it in the windows registry:

  1. Open regedit
  2. Goto HKEY_CLASSES_ROOT\your_class\Shell
  3. Add a new key and give it a name
  4. Edit the (Default) value of this key and insert the text you want to show in the context menu
  5. Add a new key named Command under your newly created key
  6. Edit the (Default) value of this key and insert the command you want to execute
  7. Enjoy!


In the "File Types" Windows Dialog you can click "Advanced" on your file type and there create a custom action tied to your application.

Possibly you can also find a way to do this in a programmatic manner, or at least create a .REG file with the equivalent registry options.