This post was most recently updated on March 13th, 2023.4 min read.
Another fun Windows-related debugging article! This time, I had to dive in to find a fix to an error along the lines of “This file does not have an app associated with it for performing this action.” constantly popping up on my Windows 10 workstation.
While I had this error constantly popping up, the same fixes should apply to the situation when the error only comes up when you’re actually trying to open a file.
The error looks somewhat like the below:
This file does not have an app associated with it for performing this action. Please install an app or, if one is already installed, create an association in the Default Apps Settings page.
One example of what this might look like is shown below:
While investigating, I saw someone mention online they got it in the form “this app does not have an app associated with it for performing this action” too, which sounds wrong, but hey – what do you know. It seems to be the same issue.
This error might pop up when you’re trying to open a file, windows explorer or just by itself. It says it’s thrown by Explorer.exe (which, technically speaking, is true). In my case, it would pop up periodically without any action on my part. A sample of that below:
Totally not annoying at all. And over the time, there will just be more and more of these windows.
Anyway – what do we do to fix this?
This issue seems to be caused by some weird interplay issue between Windows Explorer and Microsoft OneDrive, at least for me. Another fun one, then. You can run into the same error without OneDrive, though, and the same fix should work.
But based on a bit of googling and experimenting, I found a few different possible solutions.
Give them a try and we’ll see if one of them works for you as well!
Time needed: 10 minutes.
How to fix “This file does not have an app associated with it for performing this action” in Windows?
- Set the default app associations
The error tells me to go to default apps and select a file association there. So I took a look at my default apps – and lo and behold, I had not selected an email application.
For a split second, I thought that the error message might’ve been descriptive (even though it was weird that it would pop up randomly). So I selected Outlook as my default mail application – but that didn’t solve the issue. The errors kept popping up occasionally.
- Shut down and restart OneDrive
Shutting down all of your OneDrive instances (I have 3 or 4 running normally) should help in case the issue is caused by your OneDrive client freaking out (and why wouldn’t it be? It’s one of the usual suspects after all), shouldn’t it?
But no it didn’t – at least for me. Not after I had to restart the clients to sync my files, that is. Before that, it was very peaceful for a second.
And actually, it got worse after the client(s) were up and running again.
But if you want to try this anyway (and enjoy the silence while your files are gradually getting more and more out-of-sync), here are the magic commands to end and restart all OneDrive processes (your path to OneDrive executable might be different depending on your system configuration!)
taskkill /im onedrive.exe /f
"C:\Program Files\Microsoft OneDrive\OneDrive.exe"
The first line uses taskkill to “kill” all processes with executable name “OneDrive.exe”, and the Force -switch (“/f”) makes it fast enough the executable doesn’t have enough time to call for help before being killed.
The second line – which you might need to double-check for your environment – restarts the client(s).
- Apply some crazy registry hacks
Making changes to your computer’s registry isn’t for the faint-hearted. Tread with caution.
Might not even apply to your environment. But maybe it’s worth checking out.
That said, here’s the link:
(None of the registry paths existed in my environment so I skipped past this step – the next step helped me!)
- Change your default Explorer view to “My Computer”
Changing the default view of your Explorer seems not related to the issue at all – but it helped in my particular case.
1. Search Start Menu for “File Explorer Options” and select the match that says “Control Panel”
2. Change the “Open File Explorer to:” option to “This PC” (see below).
Then you should get rid of the pesky error windows!
- Restart your machine
“Have you tried turning it off and on again”? As boring as it is, this will typically help.
If you don’t apply one of the earlier fixes as well, this will likely only be a temporary fix, though. So give the other ones a try as well for a lasting effect.
And that’s it – I hope! Did it work for you? Feedback, new ideas, constructive criticism? Let me know in the comments section below!
- Automatically get version number from project dependencies in Azure DevOps - March 28, 2023
- Solving “AADSTS90097: An error has occurred during admin consent processing.” issues in your app - March 21, 2023
- How to fix your MAUI Blazor app crashing on startup with “Failed to compare two elements in the array.” ? - March 14, 2023