Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You may have noticed already that file type association has changed fundamentally in Windows 10. It is no longer possible for Administrators to set the default application for a certain file type dynamically. The only remaining option is, to create an XML file containing the desired FTA’s and import it using DISM (only valid for new users) or apply it using GPO (valid for all users on a PC). Here’s a good technical explanation about how FTA works in Windows 10.
The solution I’m providing here adds a bit of dynamics to the file type association topic (FTA). It is still a workaround but it lets you modify file type associations by using a Powershell script. Make sure to configure your environment as mentioned below.
Prepare your environment
<?xml version="1.0" encoding="UTF-8"?> <DefaultAssociations> </DefaultAssociations>
On a client, which is in scope of the GPO, do a GPUPDATE and log off/on to apply the changes. The settings of you FTA XML should now take effect.
You can check the registry for verification. If you changed, for example, the assignment for .AVI files in your config file, you should find a registry value HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.avi\UserChoice\ProgId. The data of this value should be the same as the ProgId specified in your XML. And of course .AVI files should open with the application you assigned it to. If this is not the case, check the event log Microsoft-Windows-Shell-Core/AppDefaults for errors.
Add script to application deployments
Let’s assume you deploy an application to a set of clients, which handles a file type you already assigned to an application in your XML. You want to change the default app for this file type. To accomplish this, simply run the Powershell script attached to this article after the installation of the new application. You can also make this part of your app deployment.
Modify-AppAssocXml.ps1 -Path "C:\ProgramData\YourCompany\AppAssoc.xml" -Extension ".avi" -ProgId "VLC.avi" -AppName "VLC Media Player"
This modifies the local application association XML file. It changes .AVI to the new AppId or adds a new line, if AVI is not yet assigned. To use this script, you should understand the values the command accepts.
Path is straightforward. It’s the path to your local FTA config file.
Extension is the file type(s) you want to modify or set. You can either specify a single extension or multiple extensions, separated by comma (i.e. ".avi,.mp4,.mpeg")
ProgID is the path to the open handler in the registry, relative from HKEY_CLASSES_ROOT to the key name before Shell\Open\Command. An Example: The open handler for “notepad.exe” can be found in HKEY_CLASSES_ROOT\Applications\notepad.exe\shell\open\command. The ProgID for Notepad would be Applications\notepad.exe.
AppName is the file description property of the corresponding EXE file. However, this value does not affect the file type association but it must be set.
Unfortunately, it requires GPO foreground processing for the settings to take effect. This means that users need to log off/on after the FTA XML has changed.
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in