How to fix Issues with Windows File Type Associationsβš‘

Contentsβš‘

View and tweak Windows Registry entries for File Associations.

Registryβš‘

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts

DISM XML Templatesβš‘

Import and export default file association template XML Files via DISM command line commands.

Export Defaultsβš‘

dism /online /Export-DefaultAppAssociations:"%UserProfile%\Desktop\DefaultAppAssociations.xml"

Import Exported XML Fileβš‘

dism /online /Import-DefaultAppAssociations:"%UserProfile%\Desktop\FileAssociations.xml"

Remove to Revert Changesβš‘

In case you want to revert the changes you have made, run this command: 

`Dism.exe /Online /Remove-DefaultAppAssociations`

ASSOC Commandsβš‘

Change associations like-so:

assoc .extension_name=file_type

For example, to associate .scr file type with notepad, execute:

assoc .scr=txtfile

# to revert
assoc .scr=scrfile
To see , list of file type associations in your system , just type `assoc | more`.

FTYPE Commandsβš‘

First run, assoc <file_type_you_are_facing_problem_with>

assoc .exe
> .exe=exefile

assoc .yml
> .yml=yml

assoc .url
> .url=InternetShortcut

Note down the output to the right of = and run:

ftype output_obtained=<absolute_path_of_application> %1

# url associate with edge
ftype InternetShortcut="<PATH to Edge>" "%1"

Links: Command Line - CMD WindowsDevEnv Windows Registry Windows Command Line Commands Overview

Sources: - https://thegeekpage.com/fix-file-type-association-error-in-windows-10/