Create a blank file with a random file extension. Let’s say
1. Open Notepad 2. Menu *File* → *Save As* 3. Give a name with your extension. 4. And save it on your desktop (you can also save it at any other location).
Now right click your file (
*.xlsx in this case) and select Open with → Choose Default Program → scroll down and select Browse for an App on this PC.
Now browse to
filename.blaw and select it.
*.xlsx file is associated with
<filename>.blaw, all you need to do is to delete the
<filename>.blaw file. Now it’ll force any
*.xlsx file to make a file association again, and you can choose application from which you want to open your file, or leave it as it is.
And this solution certainly works!
The same process also works for Windows 10.
I think you missed the other SystemFileAssociations xlsx list in HKCR.
Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOTS\SystemFileAssociations\.xlsx] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xlsx]
To be sure everything is good, next go here and check the default setting on xlsx, usually it will point to another key in HKCR or sometimes have a long GUID referencing a persistent handler.
Either way we need to then jump to
HKCR\xslx_auto_file or search for the GUID of the persistent handler and make sure everything looks chrome free.
Another option (tested under Windows 10) is to open CMD as administrator, then run:
(So you specify nothing behind the =).
For me, this stopped a downloaded .csv file from opening in Excel*. The download prompt still contained Open with Excel as default suggestion, but it let me choose Save to disk instead.
* This does NOT properly format the data into columns (probably because the default settings don’t match), which makes associating CSV with Excel useless.
FileTypesMan is free utility that you can use to change associations or even better yet (the way I used it):
I opened FileTypesMan.exe, selected the extension with the wrong application association, and clicked on menu Edit → Open File type in Regedit… Bam, it went right to it… Then I went to the open key under the filetype, cleared the data in the default regkey, closed regedit, and refreshed my Windows Explorer (F5). Wallah, done!
I add it up there, as there’s no mention of it in the above answers.
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:
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.
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
.cmd, and deleted it altogheter.
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).