Today I accidentally associated a file extension with an app that should not be opening them by default at all, and because the option Always use this app to open *.xyz files was checked, Windows remembered it afterwards. I was in real trouble, since in the Control Panel under Default Apps section there is no option to reset / remove association for individual files – only GLOBAL RESET option. Thanks Microsoft!
How can we easily fix this without any 3rd party software?
How To RESET File Association with App / Program In Windows 10?
Well, it turns out this is fairly simple to do, however, there are few gotchas that I experienced by doing this. Of course, we need to edit Windows Registry. Before you proceed, make a backup copy of it. Before you proceed, make a backup copy of it! Did you make a backup copy? Ok, continue reading.
If you don’t know how to make a backup copy of Windows Registry, maybe you should learn that step first, and then return here. I will not be responsible for any damage to your computer you do by following this tutorial and messing up with it!
Ok, now that that legal crap is settled, let’s move on to business, shall we?
STEP 1: Run Windows Registry
This is very straightforward – just click on START button at the corner (or alternatively magnifier/loupe icon) and start typing “registry” somewhere. Right-click on regedit and select Run as administrator option (just in case, it may not be required).
STEP 2: Edit Windows Registry
All right, once we’re inside Matrix, we can start hacking. Hold CTRL button and hit F key on your keyboard (CTRL+F) to bring search window in front. Alternatively, hit F3 key. Another alternative: go to Edit in the menu and hit Find… command.
In search input box type your extension name with the dot (.) symbol in front. This will minimize false positives in case you have some other keys or strings with that name (but without dot in front, e.g. not an actual extension, but something else). For example, in my case extension was .vdscript, so I simply typed in .vdscript just like that. No quotes, no nothing.
Once you find what you are looking for, you should first verify that it is located under appropriate section (read below) and then delete entire key (‘folder’) named: .your-extension
* * *
Instead of using search function, you can also manually navigate to:
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts
section simply by expanding appropriate tree branches / sections / titles represented by › symbol on the left.
You can also copy/paste above path directly to the path indicator / input box (outlined in rectangle-shaped red border in above screenshot).
However, this is just one place that holds information about extensions and file associations. There are other places, as well, for example, at least several S-1-5-some-long-numbers-here sections each containing file extension associations, so manually navigating through a tree with million rows and branches can be a tedious job.
Computer\HKEY_USERS\S-1-5-IDENTITY-STRING-1\Software\Microsoft\Windows\CurrentVersion\FileAssociations\
Computer\HKEY_USERS\S-1-5-IDENTITY-STRING-2\Software\Microsoft\Windows\CurrentVersion\FileAssociations\
Computer\HKEY_USERS\S-1-5-IDENTITY-STRING-3\Software\Microsoft\Windows\CurrentVersion\FileAssociations\
etc.
Computer\HKEY_USERS\S-1-5-IDENTITY-STRING_Classes\
Use search. And then F3 function key (or alternatively Edit > Find Next command) to jump to the next one, then next, in cyclic order.
STEP 3: Delete Specific Registry Keys
Now, we need to delete all keys of our extension represented as directory (folder) icons in Registry Editor’s tree, so I may refer to them as ‘folder’, ‘directory’ or ‘directories’ on occasion. However, they are technically called keys.
How do you delete some key in Windows registry? Simply right-click over the particular key and hit Delete option from the popup window’s menu (exactly the same like when you work with ordinary files). Then hit F3 to find next target and repeat until you get no more results in search.
As mentioned in previous step, one such place is in:
- HKEY_CURRENT_USER branch
Another one (or, more then one, actually) is/are stored in:
- HKEY_USERS branch
Remember, the safest way is to delete entire keys, however, in some places you may find AssocFile value for our extension, delete that / those as well. Otherwise, if you do not delete AssocFile values, Windows will still open that file with the wrong app!
As I mentioned, in HKEY_USERS branch we have to repeat this procedure, essentially, exactly the same – for each identity separately. The sections look very similar, if not exactly the same (only the paths are little different).
Once you perform the keys deletion procedure, your file should no longer be associated with the old app, and, in fact, you should be back to the previous stage, as if you never associated it with in the first place.
STEP 4: Temporarily Uninstall or Remove Associated App
This step is optional, however, in my case it was required. Since the app was portable (no actual installation was performed, neither it was available), Windows still somehow memorized the wrong file association. Even after I removed all the keys from the registry (it was possible that I missed some important place), the problem was always coming back.
I temporarily deleted the associated .exe application to Recycle Bin and then double-clicked on that file to try to open it. Windows finally started reading my mind and detected that the app is no longer available, so it showed me a path to the old location where the .exe app was residing before I “deleted” it. Then, I searched in the registry for that path value (without quotes) and – eureka! There was, after all, one string left in there (AssocFile string) which I forgot to delete. After deleting that string (entire key, actually), file was no longer represented with an old app’s icon, and it was completely reset and restored to the blank file one.