How to Prevent your Antivirus from Blocking C/CPP .exe Files in Windows 11

Antivirus Blocks C or C++ Executable files | VS Code | Windows 11


 An Antivirus is a utility software used to detect and eliminate viruses & possibly harmful files from a computer. Sometimes, it just so happens that the antivirus may falsely identify the executable(.exe) file of the C or C++ source code file to be a virus and may automatically delete it. This article deals with the prevention of the same. 

Problem!


What is Real-time scanning and how is it related to this issue?

Real-time scanning is a feature that continuously scans your computer against viruses, potential threats, etc, and if detected, will instantly eliminate them. It is because of this feature that your antivirus prevents executable files(.exe) from running as it falsely identifies the file to be a virus.

So in order to avoid it, just turn off the real-time scanning feature from your antivirus. You'll then be able to run the executable file.


How to turn off Real-time scanning in McAfee®?

In order to turn off the real-time scanning feature from McAfee® antivirus, follow the steps

  1. Open the McAfee® Antivirus home page on your computer.
  2. On the top left of the window, click on My Protection.

  3. Click Real-time scanning from the list. 

  4. Now you can either turn off real-time scanning or choose to exclude the .exe file from real-time scanning. 

  5. It's up to you to choose one. If you ask me, I'd suggest you turn off real-time scanning and turn it back on when your work's done rather than choosing the Exclude Files option as every time you update the source code, its .exe file gets modified resulting in it getting removed from the Excluded files list and you have to manually add it once again.
  6. Save and close the window. Now you can run the executable files on your computer. Compile and run your code. 
    Before fix

    After fix




Thanks for reading. If you found any errors or have suggestions to improve the article, please mention them in the comments.

Post a Comment

0 Comments