In an ideal world, Windows would know. In an ideal world, it would simply open the file, or, if you needed to take additional steps, it would tell you what those steps would be.
I’m sure by now you realize we don’t live in an ideal world.
We need to learn a little about file types and file associations. Then we’ll know how to answer the question we’re being asked.
Become a Patron of Ask Leo! and go ad-free!
File types
You may notice that the files you use and interact with in Windows1 have names that end with what’s called an “extension”. That’s the set of characters following the last period in the file’s name. For example, the file named “explorer.exe” has an extension of “.exe”.
Extensions tell us what type of file it is. An “.exe” file is an “EXEcutable” file — a file containing a computer program that can be run, or “executed”, on your computer. “explorer.exe” is the file containing the program Windows File Explorer.
There are hundreds, if not thousands, of different types of files. “.doc” and “.docx”, for example, are DOCuments, typically in Microsoft Word and Microsoft Word’s eXtended format, respectively. A “.jpg” is a picture stored in JPEG (Joint Photographic Experts Group) format.
File associations
Not every program can open every type of file. Windows needs to know what program(s) can be used to open each specific file type, and if there are more then one, which one should be used by default.
This is called an “association” or “file type association”. For example, the Windows program Notepad is typically associated with the “.txt” extension, which represents a plain text file. Double click on a “.txt”, Windows looks up the associated program — Notepad — and runs it to open the file.
Similarly, if it’s installed, Microsoft Word is generally associated with “.doc” and “.docx” files. Some kind of picture viewing or editing program will be associated with “.jpg” files, and so on. Even “.exe” files have a special association with Windows itself, since it has to know that they’re programs to be run.
If you double-click on a file that has no program associated with its file type, Windows doesn’t know what program to run to open it. “How do you want to open this file?” is the result.
Choosing from a suggestion
To get the dialog box pictured above, I created an “.ask” file that Windows doesn’t know what to do with, and double-clicked on it.
Windows has a fairly large default set of suggestions available; just click on the More apps link.
It’s important to realize there’s no guarantee that these suggestions will work — they’re just programs that can open a large number of different file types. Windows really doesn’t know what to do with the file I’ve double-clicked on, so these suggestions are — to put it bluntly — a shot in the dark.
In my case, one of those suggestions will work just fine: Notepad. So I’ve clicked on that.
The checkbox “Always use this app to open .ask files” is checked, meaning that Windows will remember this as an association in the future. If I click OK this time, then the next time Windows won’t have to ask. It’ll remember that “.ask” files are associated with Notepad.
Clicking on OK makes the association and opens the file in Notepad.
Changing an association
To change (or bypass) an association, start by right-clicking on the file you want to open, and then click on Open with…
This will open the same “How do you want to open this file?” dialog, but with the current default (Notepad in my case) listed.
Click on More apps to display the list of suggestions once again.
This time I’ll click on Wordpad, as it can also open plain text files.
The “Always use this app to open .ask files” is worth comment. I can do either of two things:
- Leave it checked: This will change the association for “.ask” files to be Wordpad permanently. The next time I double-click on an “.ask” file, Wordpad will be used. You would use this to make a permanent change to the program to be used to open these files in the future.
- Uncheck it: This will leave the association for “.ask” files unchanged. The next time I double-click on an “.ask” file, Notepad — the existing association — will continue to be used. You would use this if you only want to open the file in another program this one time.
Regardless of how I set the checkbox, when I click OK, Wordpad is used to open the file.
What if the program you want isn’t listed?
You might notice an additional link in the dialog boxes above: “Look for another app on this PC”.
Click on that, and you’ll be presented with a traditional File Open dialog box. The intent is that you locate the program (the “.exe” file) that you already have installed on your machine that knows how to open the type of file you’re dealing with. Locating that program will require you to know what folder it was installed into; usually a sub-folder of one of the top level “Program Files” folders.
If you don’t have a program already installed on your machine that knows how to open that particular file type, none of this will work. You’ll need to locate such a program and install it on your machine. Typically, doing so will automatically set the association for you.
What if I don’t know what I want?
If you don’t know what a file type represents, or what program might open a specific file type, then it’s time for some research. The short answer is you’ll need to:
- Understand the intent of the file type you’ve been presented with. For example, knowing that (or looking up on the web) “.jpg” is an image file.
- Locate a program that knows how to deal with that file type. That might mean realizing that the already-installed Paint program will work for your images, or that you might need (or simply want) to install and use a different program that’s more suitable to your needs.
I actually experienced this several years ago. I’d asked for some of my medical imaging in digital form for my records, and received the images in what is apparently a medical image standard format. Unfortunately, it’s not a general purpose standard, and I had no way to open the files.
I researched the file extension used2 and learned that the IrfanView image viewing program would display it properly. I installed the program and the association was made for me, after which I could simply double-click on the file.
Do this
Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.
I'll see you there!
Windows 10 was good at allowing us to set a program to handle all defaults that it’s able to handle. After the latest large update from Microsoft, that setting is hidden somewhere else. Fortunately, one can get the window needed to set all defaults by pasting the following into the “Search” or “Cortana” window:
“control /name Microsoft.DefaultPrograms /page pageDefaultProgram” (Without the quotes).
This window is especially useful to “De-Edge” a PC soEdge stops trying to be a browser, PDF reader, etc. By setting Adobe Reader to have all defaults, and Chrome or Firefox to have all theirs, you suddenly are released from the chains of Edge.
Team Leo …. is this suggestion something a less skillful computer user should try? I don’t want to use Edge, but it does pop up sometimes, so this appears to be an option.
All it takes is following the steps outlined in this article. You can try it out. You’ll see it’s pretty simple to do. If you don’t like your default browser, you can right click a .html file and a .htm file and set the default to Firefox, Chrome, Opera or IE. A simpler way to change default browsers is to open the desired browser, and it will usually ask if you want to make that your default browser.
In Win 10 I run several old Win 98 or Win 7 programs. Every time I load them I get this message. “Do you want to allow this app from an unknown publisher to make changes to your device?” (Y/N)
I say yes and everything works fine. But why do I have to answer this question every time I load the program? Is there some way to tell Win 10 this is a good program, no need to ask anymore?
Enjoy your newsletters, keep up the good work.
Thanks,
Frank
It’s unfortunate that UAC (User Account Control) doesn’t have a way to whitelist programs you use regularly. There may be some security reason for this, such as in case malware hijacks a program you normally would trust.
I was hoping you’d touch base on the “Look for an app in the Store” option, as I’ve had to use it on more than one occasion, with very mixed results.
More times than not, the Store wants to sell me something that I’m not sure will work unless I buy it first.
I rarely use or touch the store. As you say, usually it’s trying to sell you something. It does have a lot of things, but honestly — the apps you usually want are more easily accessible elsewhere. Except if they’re Microsoft apps, in which case the store might be the only option. But rarely is a Microsoft app the only solution. It really depends on what type of file you’re opening.
My problems with file associations are:
1. I wanted to try opening a file with Notepad, but I accidentally left the make it the default option checked. Turns out I don’t have a program to read the file, so nothing should be associated, but Notepad is now associated. I haven’t figured out how to remove the association.
2. I don’t want to change the default association for .jpg files, but I want to add a menu option in the right click menu to “Edit With Paint Shop Pro” … one click instead of multiple clicks.
Both of these were easy in earlier version of Windows, but I haven’t figured out how to do these things in Windows 7.
I don’t have a way to remove an association … only change it to something else.
Open shell:sendto and you can create a link for Paint Shop. Then you can “Send To” Paintshop.
Take a look at this link:
https://answers.microsoft.com/en-us/windows/forum/windows_10-files-winpc/how-do-i-disassociate-a-file-type-in-windows-10/1c0e6768-d02b-4162-9e8d-2bc9f7eaf051?auth=1
But that may not do it:
Before you do anything in the Registry create a restore point and ALSO export each registry item you want to delete to a .reg file so you can restore just what you deleted easily. For example, if you want to delete a folder in the Registry, right-click on it and select Export. That will create a .reg file, which if you double-click, will restore the registry entry.
To get rid of a file extension association in the Registry, search Keys for the extension such as .xyz.
(Make sure you search for Keys only, these are represented by the folders in the Registry).
The extension key may appear in several places in the Registry:
HKEY_CLASSES_ROOT\.xyz
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\…..\.xyz
HKEY_USERS\S-………..\Software\Microsoft\Windows\CurrentVersion\…..\.xyz
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.xyz
Delete each key.
Of course, the safest option is to leave well enough alone. The Registry is already a mess of unnecessary and obsolete stuff anyway.
Yeah, even I find this pretty scary stuff. :-)
I’d probably feel safer changing the association to something benign over removing it completely that way. I DO wish MS would provide that ability once again more cleanly, though.
Thanks, Leo, for another helpful article which has prompted many equally useful comments. Unusually, for me, I haven’t found the answer I’m seeking and am compelled to ask a question. Let me explain…
I use Microsoft Office [via Office 365] extensively on a Samsung R730 laptop running Windows 10. Whenever I receive an attached Excel file in Outlook, I can preview it but cannot open it. I’ve tried everything, including checking file associations which are set as I would expect, and the only way I can open Excel files received as an e-mail attachment in Outlook is to first save the file and then open with Excel in the usual way. Because of the way folders are structured in my directory tree, this can be very time-consuming and most frustrating. Incidentally, all other Office files received as e-mail attachments in Outlook open normally and automatically in their respective programs.
Do you or any of your readers have any suggestions?
Saving the file and opening it from your computer is the proper way to open an attachment. If you open it directly from the email program or webmail page the attachment is in a temporary folder. That’s why Excel won’t allow you to edit it. There are ways around that, but it’s generally best practice to save attachments before opening them.
hi, i’m just wondering how to close the dialog if i change my mind and don’t want to do anything.
for instance, in your example above where you explain how to change the file association, the dialog pops up and the OK button is disabled and there’s no Close button. this happens to me a lot! i’ve just been clicking outside the dialog and hoping it closes in the background. is that what happens?
thanks,
s
The Escape (Esc) key closes the dialog.
Please help, I want to save my files in my mails to word or excel what ever the file is, what must I do, because now every file save as internet explorer then I cant use it or open it
I don’t know if I go as far as calling it a shot in the dark. It’s more of an educated guess based on a database of programs which are known to open that kind of files. The shot in the dark comes when you have to decide which one to try.
One thing that’s been happening a lot, lately. Almost daily. I double-click on a file with an extension that I’ve opened dozens if not hundreds of times and I get the “How do you want to open this file” dialog. It includes the option to continue to use the program I’ve been using. It seems like a bug as Windows knows it’s been my default and there’s absolutely no reason to ask as I can always use “Open with” if I ever want to change.
Microsoft, We Deserve Better