Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm deploying a small conversion tool on some systems, and want the users to be able to run it from the right click Open with menu. But I don't want to change the default program users have associated to this file type.

It is easy to associate a file extension/type to a program, but how to do it (programatically of course) without changing the default program?

like image 650
CharlesB Avatar asked Jun 02 '10 08:06

CharlesB


People also ask

How do I associate a file extension with a program?

Open the Control Panel. In the Control Panel, click the Default Programs option. Click the Associate a file type or protocol with a program option. In the Default apps window, scroll to the bottom and select Choose defaults by file type.

How do I force a file to open with a specific program?

From the desktop, right-click the desired file. From the drop-down menu, click Open with, then select the desired application.

How do I change the default file association?

Choose Programs > Make a file type always open in a specific program. If you don't see Programs, choose Default Programs > Associate a file type or protocol with a program. In the Set Associations tool, select the file type you want to change the program for, then choose Change program.


1 Answers

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>
like image 57
CharlesB Avatar answered Nov 01 '22 23:11

CharlesB