Associating a file type with a program can be done using several ways, such as using the Open with… dialog and selecting the “Always use this app to open” checkbox, or via Default Programs or Default Apps. While you can set or change associations using GUI, there is no option provided to delete an existing file type association.
This post tells you how to remove file type associations using the Registry Editor.
Remove a File Type Association Using Registry Editor
Let’s say you’ve incorrectly associated a file type named .bak, and want to remove the association. Use these steps to remove the file association settings (for .bak) from the registry.
- Start the Registry Editor (
regedit.exe
), and go to this branch:HKEY_CLASSES_ROOT\.bak
- Note down the (default) value data in the right pane. It’s the ProgID associated with that file type.
- Right-click the key .bak, and choose Delete. Click Yes to confirm.
- Go to the following
HKEY_CURRENT_USER
keys and delete the.bak
key.HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bak HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.bak
This should remove the file association settings for
.bak
file type. The deleted file type should now be treated as unknown by Windows; which is exactly what we wanted.Delete the Progid as well (optional)
If you also want to clean up the ProgID key for that file type, which you noted (
bak_auto_file
) in Step #3 above, you must do so only if that ProgIDbak_auto_file
is not used by any other file type. This is important.How to find if any other file type(s) is mapped to the same ProgID? Do a search (for Data containing the ProgID string – match whole string only) in the Registry Editor. Or run one of the commands given below to find it out.
This time, let’s take the example of
txtfile
Progid. To view the list of file types that use thetxtfile
ProgID, run:Example: txtfile (progid used for .txt)
assoc | findstr /i "txtfile"
(or)
reg query hkcr /d /f "txtfile" /s
In the above case, the following file extensions are still using the txtfile progid:
.LOG | .SCP | .TXT | .WTX
So, you should not remove the
HKEY_CLASSES_ROOT\txtfile
registry key, as it would break the association settings for other file types that use this key.Now, let’s use the above method and find out if any other file extensions are using the
bak_auto_file
Progid. Running the command forbak_autofile
, you get this:As no other file types are using this ProgID, you can safely delete this key:
HKEY_CLASSES_ROOT\bak_autofile
Summary
To remove the file association settings for .bak
file type, we’ve deleted the following registry keys:
HKEY_CLASSES_ROOT\.bak HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bak HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Roaming\OpenWith\FileExts\.bak HKEY_CLASSES_ROOT\bak_auto_file
That’s it! Hope this guide helped you delete an unwanted or incorrect file type association on your Windows computer.