What to Do If Windows Doesn't Recognise an .exe File

The command that restores the association in seconds, and when it can be a sign of a virus.

Easy 1 min read Published on 2026 By Equipo SolucionaPC

You double-click an .exe file and nothing happens, or it opens with Notepad instead of running, or Windows asks "which program do you want to open it with?" — as if it didn't know what to do with an executable. The cause is almost always the same: the .exe file association has become damaged.

The fastest fix

Command Prompt as administrator:

assoc .exe=exefile

This command gives Windows back the correct association between "an .exe file" and "how to run it". Restart the machine afterwards for the change to take full effect.

If that doesn't fix it

  • Run as administrator: right-click the file → "Run as administrator" — some programs need elevated permissions to start.
  • Compatibility mode: right-click → Properties → "Compatibility" tab → try running it while simulating an older Windows version.
  • Try another user account: if it only happens on your profile, the problem is with that specific account's configuration, not Windows in general.

Warning: if the .exe file comes from a source you don't recognise (an email, an unreliable website), it not running could be your antivirus protecting you, not a bug. Before forcing anything, confirm you trust the file's origin.

If the problem showed up after a virus

Some types of malware deliberately modify this association to block antivirus and security tools (which are also .exe files). If this started suddenly with no clear reason, it's worth ruling that out with our guide on how to remove viruses and malware before continuing to adjust file associations.

Frequently asked questions

Is it safe to run the assoc command?

Yes, it's a standard Windows command that only restores the association between the .exe file type and its correct way of running — it doesn't modify or delete any personal file.

Why does it ask me 'which program to open' an .exe with?

It usually means the file association has become damaged or modified, by a virus or an accidental manual change. The assoc .exe=exefile command usually fixes it.

Could a virus be the reason it won't run?

Yes, some types of malware modify this association on purpose to block antivirus or other security tools. If the problem showed up suddenly, it's worth ruling that out.

Share: