This post was most recently updated on June 19th, 2022.3 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 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 how this might look like is shown below:
This error might pop up when you’re trying to open a file, windows explorer or just by itself. 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?
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 the error message might’ve been descriptive (even though it was weird 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 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, at least for me, it didn’t. 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 clients 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!
And that’s it – I hope! Did it work for you? Let me know in the comments -section below!