Thursday, April 7, 2011

"File does not have program associated with it" when trying to run any application in Windows

Update 11/21/2011:

After receiving a comment regarding this not working in the Run As Administrator mode, I did a quick search and found a Microsoft FixIt post that has a fix it for me option. You can find that link here: If you can get the automatic fixer tool to run then that should clear up your problem, otherwise this article also lists the manual steps you can use to clear it up.

Original Post:

I had a user bring in a personal machine today (running Vista) and ask why she couldn't open anything on her computer. Immediately I told her she was likely infected with something, and it turns out she was. I used Spybot and MalwareBytes Anti-Malware to clear the infection. If you're not familiar with adware removal, check out one of my early posts. Afterward she was left with an error when trying to open anything. It said "This file does not have a program associated with it for performing this action. Please install a program or, if one is already installed, create an association in the Default Programs control panel." For those of you who are more visual, it looked like the image below.

If you have this error don't bother with the Default Programs control. Instead, I found a Microsoft KB article that outlines the steps that worked for me, which you can find here. I used a slightly modified version, which is what I'll explain here. My version is specific to Vista and should work on Windows 7, but likely won't work for XP. If you have XP or run into problems with my method, feel free to check out the KB article for the official walkthrough. Or there's another KB article listed here.

1. Open My Computer and go to C->Windows
2. Find regedit.exe, right-click and choose Run As Administrator. This will open the registry editor

Be careful to only change what is listed below from this point forward. Any other changes to the registry could potentially screw up the computer and require an OS restore.

3. In the left-hand pane, navigate to HKEY_CLASSES_ROOT->exefile->shell->open->command. In my case the command key wasn't there so I had to create it. If you are missing command, right-click open, select New Key, then type command there. This will create the command sub-key for you to click on.

4. In the right-hand pane, double click on (Default) that is listed inside command

5. Change the Value data field to "%1" %* exactly like that. To be clear that is quote then percent then 1 then quote then space then percent then asterisk

6. Click OK

7. Close Registry Editor

Now you should be able to open your applications again.