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.


Louise said...

Hey dude,
this is very helpful, except when I go to the "value data" field, there are already 4 zero's (0000) that will not erase.
Is that normal? Should I leave the zero's and put the "%1 %* in behind the zero's?

rslygh said...

When you look at the Type column of that value in regedit, do you see REG_BINARY? That would explain why you can't erase them. The (Default) key in command folder at the path given should be type REG_SZ (String value). If it's not first make sure you're at the right spot in the registry. If you're certain you are, delete the entire command key. Then right-click the parent folder named open and choose New->Key. Name the new key command, and make sure the (Default) value within it is "%1" %*

Anonymous said...

I am so grateful for how you were so explicit with these instructions. I have read several fixes that were similar, but I am always hesitant to mess with regedit. You really put me at ease and allowed me to fix the problem. Thanks again!

Anonymous said...

By following your instructions I was finally able to fix my Win7 registry which was corrupted by Win 7 security 2012 virus. God bless and thank you!

Unknown said...

I'm getting this same message but not under the same circumstances. I was until a month ago having issues opening some, but not all, .exe files using Windows 7. I found a fix file for that and it seemed to take care of the problem, except for when I right click and try to run as administrator. Whenever I attempt to run as administrator I get the exact same message as the one you discuss in this posting. I know this is an older posting but I have not been able to find anything specifically dealing with my problem. Any help you could offer would be greatly appreciated

rslygh said...

I'd give the fixer tool from Microsoft a try, If that doesn't work maybe try disabling the UAC and then re-enabling it.

Anonymous said...

Thanks, mate. Simple and effective.

Bev Luck said...

Hi there,
My husbands laptop is having similar problems. I would love some help if you don't mind.
He has Windows 7 SP1
When we click on any folder we get the error message "the file does not have a program associated with it..."
I have downloaded some possible fixes, but am unable to open anything because the same error message comes up. I am able to get on the internet via his "favorites" and it goes to them and I can search from there for different things. I can also download, but anything I download or add from jump drive and try to open gives me the same error. I am also not able to change to administrator.
I have Kaspersky AV and have spybot but he hasn't run it since Nov. 7th.
Thanks for any help. I'm about to give up and take it in for repair.
I had a restore disk I made when we purchased the computer, but no windows disk but those won't run either.

rslygh said...


My first suggestion would be to start the computer in safe mode. You can do this by pressing F8 before the Windows logo screen appears. This will be your best bet for trying to diagnose the problem further. If you have another computer you could use, pulling the hard drive from your husband's computer would be a second option. You can then connect his hard drive as a secondary drive on the other computer and run antivirus and antispyware scans on it from there. This prevents the malicious programs from starting with Windows since the bad drive doesn't hold the OS. I would suggest also scanning with MalwareBytes Anti-Malware (MBAM). Spybot is good but doesn't always find anything, so complimenting it with MBAM normally helps to find anything that was missed. Neither of them are complete in themselves, but I've found that the combination works pretty well.

Ivan in SD said...

I can't even open up regedit.exe because when I go to open it up I get the same error message. I am not able to go any further in the fixing the issue so if you have any other suggestions I would greatly appreciate it. Thank you very much

rslygh said...

Ivan, you can try to rename regedit.exe to and then open it to make the changes. Then just revert back to the original name afterward. You can find regedit in C:\Windows\. If you don't see the .exe extension you'll have to set your system to show known file extensions. If you don't know how to do that you can consult my previous article located here

Martin said...

I have the same issue as Ivan, but attempts to rename it result in a 'destination folder access denied' message. My problem started when I attempted to remove the vista home security virus manually through Regedit. I may have deleted something important... Any advice?

rslygh said...

If you can't get regedit to work and renaming it to a .com file doesn't work, the best way to solve this would be to backup (if you don't already have one) what you want to keep, then go ahead and reformat your hard drive and reinstall Windows and your software. It's kind of a pain, but in the end after all the time spent messing around with trying to remove some of these viruses you realize you would've been better off reinstalling. It's also the only true way to know you were able to fully remove the infection.

Anonymous said...

Great help! Thank you so much!