Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How Do File Associations Populate The ProgId And ApplicationName

Where does the ProgId and ApplicationName below come from? How can I query for these specific fields to make my own file association xml file?

You can get this file by running

Dism.exe /online /Export-DefaultAppAssociations:C:\Temp\DefaultApps.xml


  <Association Identifier=".html" ProgId="ChromeHtml" ApplicationName="Google Chrome" />
  <Association Identifier=".ico" ProgId="PBrush" ApplicationName="Paint" />
  <Association Identifier=".md" ProgId="Applications\notepad.exe" ApplicationName="Notepad" />

For example what is "ChromeHtml"? Where can I retreive this ProgId?

What is "Applications\notepad.exe"? <----this is not a path I can navigate too. Isn't notepad.exe in system32?

like image 337
nlstack01 Avatar asked Oct 04 '17 15:10

nlstack01


People also ask

Where can I find the ProgID entries used for file associations?

The ProgID entries used for file associations are located under HKEY_CLASSES_ROOT in the registry. Programmatic Identifier Elements Used by File Associations For additional information, read How To Register a File Type for a New Application

How do I associate a file type with an application?

The Shell uses a programmatic identifier (ProgID) registry subkey to associate a file type with an application, and to control the behavior of the association. The ProgID entries used for file associations are located under HKEY_CLASSES_ROOT in the registry. "ChromeHtml" is a ProgID created by the Google Chrome developers.

How do I deploy the default file associations?

To deploy the default file associations, you first have to configure the settings on a reference machine and then export the configuration in an XML file that you can deploy in your network.

What are file associations in Windows 10?

A file association is a relationship between a file type and the program that will open that file type. In Windows 10, you can change the file associations for a particular file type or all file types. You can also set the default program to open files of a specific type.


1 Answers

ProgId in this context:

The Shell uses a programmatic identifier (ProgID) registry subkey to associate a file type with an application, and to control the behavior of the association. The ProgID entries used for file associations are located under HKEY_CLASSES_ROOT in the registry.

"ChromeHtml" is a ProgID created by the Google Chrome developers. When you choose Chrome as your default browser the .html file registration is changed (by Chrome or Windows depending on your Windows version) so that it points to the ChromeHtml ProgID. The ProgID contains information about which application to start when you double-click on a file.

"PBrush" is a ProgID created by Microsoft.

"Applications\notepad.exe" is however not a ProgID specifically created by Microsoft, it is the result of using the "open with" functionality with an application that has no real ProgId. It is not a file path, it is HKEY_CLASSES_ROOT\Applications in the registry.

Applications that participate in the Default Programs feature are registered under HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications and that leads you to their Capabilities key where their types are listed along with the ProgIDs. Other applications only have a App Paths registration and some applications are not registered anywhere except directly in HKEY_CLASSES_ROOT with their file extension and ProgID.

Some applications use a "ApplicationName" entry in their registration but this value is not documented as far as I know and you probably want to call something like AssocQueryString(ASSOCF_INIT_BYEXENAME, ASSOCSTR_FRIENDLYAPPNAME, ...) instead.

like image 78
Anders Avatar answered Sep 24 '22 10:09

Anders