I add it up there, as there's no mention of it in the above answers.
UserChoice
From Windows Vista/7 onward, there's another concurrent way that Windows uses, to add the associations that are set up by users in the new Associate dialogs - and they are stored separately from the system and program association already there.
So, standard and configured association continues to live in background, while user see into explorer the association it has entered.
How we get into this
The mechanism is activated when an user goes into Control Panel / Default programs / Set file associations
(disclaimer: my Os is not in english, should be about like that anyway), and it selects an extension or file type, then an application to be used to open it always, and finally saves his choice.
Sadly, the Windows dialog above said, enables the user to only change or set an association, but not to remove its previous mistakes ... this puts users in big danger, to put himself in a 'cul-de-sac' complete impasse situation.
Where it goes
Anyway, it all gets saved into registry at:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\[.extension]\UserChoice
That newly added key has about three values under it, one of them points to the executable associated. Do a search of UserChoice
in registry, to see if you have done one similar choice in the past.
Looking around under the father [.extension]
key, we clearly see that any other existing association data values and reg keys outside UserChoice
, both under \Fileexts
and elsewhere in the registry, are not touched by this mechanism.
It is very important to understand that these UserChoice keys are only added as appendix to the existing association old way mechanism, and do not interfere with it, so, removing that key directly, reactivates the preexisting situation, whatever.
Repairing
After finding the above key in registry, and deleting it brutally (there are no consequences as there is not any appendix or clsid or progid linked to key's values, only an executable name), then restarting the windows explorer completely (right click + restart in task manager), all workings will come back to normality.
Oh My Bad
For instance, one day I wrongly changed the .cmd
extension for testing purpose, assigning to notepad, just to be sure that no execution occurs on a given cmd script.
My bad, as, thank to above MS logic, I was unable to back-step my error.
By seeking the registry, I've found the UserChoice
key that was linking Notepad.exe
to .cmd
, and deleted it altogheter.
Then restarted Explorer
process, and going back to the folder, all was back in the right place, and .cmd
extension was working again as expected.
Note: Above mentioned FileTypesMan utility from NirSoft do keeps this in account (see version history below) and gives access to involved UserChoice registry key directly, from version 1.40 onwards (current is 1.90).
HKEY_CURRENT_USER\Software\Classes\.xlsx
registry key?