Why does Windows ask me to pick a program with which to open a file, even when I already specified which program I want to use to open the file?


So you're working at your computer, everything is humming along just fine, and then when you double-click a file, instead of launching the associated application, Windows asks you what program you want to use to launch the document. Why doesn't it just follow the instructions you gave it already?

A customer installed a new program that supports XYZ files, but was careful not to let that program take over as the XYZ file handler. But when they double-click a XYZ file, they still get the "How do you want to open this file?" dialog.

How do you want to open this file?
Keep using this app
Contoso Deluxe
The industry leader in XYZ visualization
Other options
LitWare Light
New
Look for an app in the Store
More apps ↆ
☐ Always use this app to open .xyz files
OK

"Could you please confirm whether this is expected behavior? If so, what is it that changes when a new app is installed that triggers this prompt?"

Yes, this is expected.

If an app is installed that registers support for a file type, then the next time you launch a file of that type, Windows will confirm that you want to stay with the app you have, rather than switch to the new one.

You should be prompted only once per file type, at least until you install another app that registers for that file type.

Why does Windows prompt you one more time after installing a program that supports the file type?

Well, you may have installed that program with the intention of making it the default handler. Or conversely, a recently-installed program may have forced itself as the default handler (possibly by nefarious means), and this gives you a chance to switch it back.

In both cases, the dialog saves you a trip to the Choose default apps by file type settings page, which is important because most users don't even realize that such a page even exists.

Comments (23)
  1. Shawn Keene says:

    I really appreciate this new behavior. It’s very similar to the behavior on my phone’s OS. Although I seem to remember Windows 8 had done it a little different. Instead of asking you to pick or re-affirm your default choice, it would show a notification informing you that “you have new apps capable of opening the thing you just opened”, and you had to click that to change the default.

  2. Karl says:

    Until nefarious applications figure out how to set the flag indication that windows has already asked the user. Then you need to create another flag.

    1. There is no such flag.

      And this behavior has been around for 6 years now.

      1. Joshua says:

        There is such flag. You can tell because the dialog doesn’t come up every time you open a file of that type.

      2. dennis2018 says:

        Oh yes, there is! It’s all in the registry. It’s just not documented for you and me. And it is only until someone reverse engineers it. Which usually happens to be done by malware or some malicious actor.

    2. TwelveBaud says:

      The “flag” is the output of a hash function, whose algorithm is kept secret and is not one of the ones readily available. Nefarious applications know where this is, but have yet to succeed at reverse-engineering the algorithm, and know that messing with it will lead to the file type having no associations at all.

  3. Entegy says:

    What a crazy coincidence. I’ve known about this dialog for a while, and respect it, but I’m running into another issue with something similar as of today. When your default browser is set to IE (I know, I know, it’s for plugin reasons that are being worked on), you get a print action in a html file’s right-click menu. If you click this print action in the context menu, you get a pop like that asking if you want to use IE or switch to Edge or another app. There’s no “always use this app” option in this case. So you get this “are you sure?” dialog every time the print action is clicked on.

    1. dennis2018 says:

      Migrate from IE as soon as possible, or embed its active X control in your app’s own dialog/window. But even that is risky. In my case when I use IE in my app, it automatically pops up another tab (covering up what my app was supposed to show) with the MS upsell to switch to Edge. This will continue …. until the next time when Microsoft abandons their current version of IE (i.e. Edge) in favor of their next latest-and-greatest piece of &^%$$….. (sorry, too many ie’s in one sentence.)

  4. Gee Law says:

    Since the blog is running auto-pilot, I’ll post comments using my MSA. There are two unsaid parts of the story. First, an installer cannot take default program for any file type (with usual way) unless the file type was unknown. Second, the customer can avoid this dialog again by checking “Always use this app to open .xyz files” (but if the installer tries to change the user-level association choice, the association is reset, in which case you will see this dialog).

    That checkbox is quite confusing because it has two usages. If you invoke the “Open with…” context menu handler on a “decided” file type, the checkbox decides whether to change the association. If the dialog is for an “undecided” file type (e.g., when a new program is registered for that type), this checkbox decides whether Windows restores the file type to “undecided” next time a new program is registered for it.

    1. Gee Law says:

      Correction: Even if you check “Always…”, Windows will ask again when a new app registers for it. This is somewhat different from what I expected…

  5. Joshua says:

    Hey, Raymond’s famous HTML Dialog Boxes are back.

  6. DWalker07 says:

    A LOT of programs can open TXT files. Including Microsoft Word and Excel, Wordpad, Notepad, and many third-party text file editors. After you install Office, and you double-click a TXT file, does this prompt come up? I don’t think it does.

    (I can’t re-test this myself.)

    1. Ben Voigt says:

      I don’t think Office registers TXT as a supported extension, even if Word happily opens one if you choose it in the Open dialog.

      There’s no link between common dialog box filters and file type associations.

      1. DWalker07 says:

        Ah, right, that makes sense. Thanks.

    2. Gee Law says:

      Excel and Word can open .txt files, but they don’t register for that. The procedure of ShellExecut-ing a file with default options roughly goes like this:

      1. Collect all possible ProgIDs.
      2. Check if there is a valid UserChoice (hash consistency check + valid ProgID), if there is one, use it.
      3. Check if there is a new ProgID associated with this file type (using ApplicationAssociationToasts), if there is one, invoke “Open with…” dialog.
      4. Check if there is a valid user-level default ProgID (classic resolving procedure), if there is one, use it.
      5. Check if there is a valid machine-level default ProgID (classic resolving procedure), if there is one, use it.
      6. Otherwise, invoke “Open with…” dialog.

      There is a problem with this procedure: If a new app is installed for .txt and the user chooses the new app in the new-app-installed-do-you-want-to-switch-dialog without checking “Always…”, the next time the user opens .txt, the default program will be Notepad instead of the selected app.

      I would expect Windows to store a “weak choice” for that case. I.e., keep using the new choice (e.g. Visual Studio Code) until a new ProgID is found, when Windows should display the dialog again. I think I read somewhere this should be the expected behavior, but it seems not to be the case.

  7. SomeGuyOnTheInternet says:

    Isn’t the settings page now called “Associate a file type or protocol with a specific program” a.k.a. “Control Panel\All Control Panel Items\Default Programs\Set Associations”?

  8. nikos z says:

    there’s a bug in windows 10 at this point that causes this dialog to be shown ALL the time. For example I have outlook 2010 (64 bit) on 64 bit windows, and when I click on a hyperlink http:// in an email, I always get the question whether to open it with internet explorer (my choice browser) or something else. No amount of swearing or confirming stops this annoyance. Thankfully it is the only program that does that.

    Also, there is always a problem with tools that happen to work with FOLDERS instead of files. The latest windows 10 update made things impossible for shell extensions that browse into archives as folders, to choose file types to associate with the NSE (a DLL basically). Perhaps you can forward this to the relevant bug report department in Microsoft? Thanks
    Details on this defaults bug here: https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/387505b4-16ca-42c0-82b7-d435397b9856/program-doesnt-appear-in-set-defaults-by-app?forum=windowsgeneraldevelopmentissues

  9. > … most users don’t even realize that such a page even exists.

    And Microsoft doesn’t seem to realize this page is an unmitigated failure in Windows 10. It is painful to navigate and difficult to operate.

    1. xcomcmdr says:

      It’s way, way better than the old 9X/XP page, which we had for way too long.

    2. Gee Law says:

      An annoying problem I’m experiencing is that the process stays around if I light-dismiss the dialog (instead of pressing Esc).

  10. dennis2018 says:

    Oh, thanks for explaining this. Now I know what to blame for my broken keyboard.

    PS. I was recently installing software on my new PC and that pop up was driving me nut.
    (It probably helped ten iPhone dummie… sorry “users” that switched to Windows, and infuriated 10 million previous Windows 7 users.)

  11. jimbo1qaz says:

    Does the Windows team realize they broke the dialog so I can no longer type the first few characters of the app I want? And the Browse button is hidden so I can neither press Alt+B nor click it, but must instead scroll all the way to the bottom to add a new program (which I do several times a month)?

  12. In an enterprise environment where app defaults are pre-configured by a sys admin, prompts like this can be a nuisance and generate unnecessary calls to your help desk. Here is a discussion about suppressing what I like to refer to as advertisements for Edge.
    https://social.technet.microsoft.com/Forums/en-US/0f58fe0d-50aa-4a83-b14e-40398e61fe30/windows-10-osd-file-association?forum=ConfigMgrCBOSD

Comments are closed.

Skip to main content