Search code examples
windowsvisual-studio-codemcafee

Program a.exe failed to run: Access is deniedAt line:1 char:1


enter image description here

Issue: Tried to run a C program using gcc in the VS code. After compilation the .\a.exe gets deleted


Solution

  • This was caused by the McAfee Security scan that was detecting the executable file as not safe. It was deleting the .\a.exe file immediately.

    Useful: link

    Solution: Exclude your project folder or the location where a.exe is generated.

    1. Open your McAfee Total protection software. enter image description here

    2. Click Settings (Right top corner)

    3. Click Real-Time scan

    4. Click Excluded Files

    5. Click Add files Browse to, and select files, which you want to be excluded from the McAfees virus scan. In this way, you can tell your virus scanner that these are known safe files not a trojan or malware

               (or)
      

    After Step 4. Click Turn off > Select the duration. This will completely stop the Real time scan for certain duration.