When you open a type of file (eg a .php file) for the first time Windows asks you to choose a program to open this file a.k.a “Open With” and from then on this type of file becomes associated with that program (unless you uncheck “Always use the selected program to open this kind of file”). While you can change this program association via Control Panel there is no option in the GUI for removing it. Windows XP had an option in the “Folder Options” (Tools Menu > Folder Option) dialog box to remove file associations but in Windows 7 you have to tweak the registry to delete a file type association. In this article we’ll see just that.
In addition to this I’ve also written on how to reset a .lnk file type association, this is when you/someone/some application accidentally (or intentionally) associates the .lnk extension with notepad (or some other program) this causes all shortcuts on your desktop and start menu to open notepad with absurd characters.
Go to Start menu > Run or press [windows] + R and enter regedit.
Before doing anything else take a backup of the registry by going to File menu > Export, enter a file name, choose a location and save. If you encounter problems in the future you can restore this file by going to File menu > Import and selecting the file.
Navigate to the following path
so for removing .html file type association go to
Right-click and choose to delete the key and click yes to confirm it.
Next navigate to
here we go to
Right-click and delete this key too.
Now when you try to open a file with a .html extension you’ll get the following window asking you to choose a program to open this file.
You might notice at this point that the thumbnails of .html files still show the icon of the previous program they were associated with, this will disappear once you logout of windows and login.
Resetting .lnk file type associations
One day when you login to your computer and open the start menu you see something similar below. Every shortcut on your desktop now looks like a text file and double clicking it opens notepad with some weird characters. This can very easily be solved by removing the .lnk association and associating lnk to “lnkfile” with a command.
The first letter in the extension “lnk” is a small “L” (l for link) and NOT a capital “i” (I for India) so be careful about this.
As mentioned previously open regedit and delete the following keys
At this stage if you open any shortcut file you’ll be asked to choose a program to open the file. To fix this open a command-prompt with admin privileges by going to Start menu > All Programs > Accessories > right-click command prompt and choose “Run as administrator”
Enter the following command
All shortcut files will now be restored to their original icons and you’ll be able to open them normally.
I’d love to hear if it worked for you, do drop a comment below.