5

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?

nlstack01
  • 789
  • 2
  • 7
  • 30
  • What file is this? A configuration file for something? You need to provide more context with your question. – Bill_Stewart Oct 04 '17 at 15:13
  • @Bill_Stewart this is an example of the xml generated by running Dism.exe. I want to create my own xml in this format. – nlstack01 Oct 04 '17 at 15:17
  • Not a stackoverflow question. – Bill_Stewart Oct 04 '17 at 15:19
  • Possible duplicate of [Add a new file association in Windows 7](https://stackoverflow.com/questions/9093481/add-a-new-file-association-in-windows-7). This is the essense of your question for _"file associations"_. The `ProgId` is incidental –  Oct 04 '17 at 15:24
  • 1
    Upvoted, as this is EXACTLY the question I want answered. – OutOfThisPlanet Mar 15 '19 at 15:20

1 Answers1

5

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.

Anders
  • 97,548
  • 12
  • 110
  • 164