How to fix vscode .exe blocked

Kei 0 Reputation points
2026-11-12T19:08:08.7866667+00:00

please help my windows security keeps blocking my .c executable 1 out of 20 tries and its annoying when im debuging

this is the message it send on my terminal (ResourceUnavailable: Program 'testnewyearanimation.exe' failed to run: An error occurred trying to start process 'C:\testnewyearanimation.exe' with working directory 'C:\test codes'. An Application Control policy has blocked this file.At line:1 char:1

  • & "C:\testnewyearanimation.exe")
Windows for home | Windows 11 | Security and privacy
0 comments No comments

2 answers

Sort by: Oldest
  1. AI answer

    2026-11-12T19:09:47.8866667+00:00

    On a personal Windows 11 PC, check whether Smart App Control is enabled and turn it off if you need to repeatedly run newly compiled, unsigned C executables.

    Personal PC: check Smart App Control

    1. Open Windows Security.
    2. Select App & browser control.
    3. Open Smart App Control settings.
    4. If its status is On, change it to Off.
    5. Rebuild the program, then start debugging again.

    Smart App Control checks an application's reputation and signature. If Windows cannot confidently classify a newly built executable and it has no valid signature, it can be treated as untrusted and blocked. There is currently no per-application exception for Smart App Control; the supported choices are disabling it or signing the executable. Recent Windows updates permit Smart App Control to be enabled again when available on the device.^1^

    Security impact: turning it off reduces protection against unknown or unsigned applications. Only run executables built from code and libraries you trust.

    Confirm which policy blocked it

    If Smart App Control is already off—or the setting is unavailable—identify the active Application Control policy:

    1. Press Windows key + R, enter eventvwr.msc, and press Enter.
    2. Navigate to: Applications and Services Logs → Microsoft → Windows → CodeIntegrity → Operational
    3. Rebuild and run the executable until it is blocked.
    4. Refresh the log and inspect events at that time:
      • 3077: an enforced App Control policy blocked the executable.
      • 3089: signature details associated with the block.
      • 3099: identifies a loaded Application Control policy.
    5. Open the event’s Details tab and note PolicyName, PolicyId, File Name, and Process Name.

    These events identify the policy responsible rather than merely reporting the PowerShell launch failure.^2^

    If this is managed by work or school

    If Event 3077 names an organizational policy, or Windows says settings are managed by your organization, changing VS Code, PowerShell, or the debugger will not bypass it. Ask the administrator to review the 3077/3089 events and create an appropriate allow rule for your development workflow. Microsoft’s troubleshooting guidance specifically recommends checking active policies and correlated block/signature events.^3^

    Do not apply .exe file-association registry fixes: executable launching works, and the reported failure is an explicit Application Control block rather than a broken file association.


    References

    1. Smart App Control Frequently Asked Questions | Microsoft Support
    2. Understanding App Control events
    3. App Control debugging and troubleshooting
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

  2. Emma1-N 15,005 Reputation points Microsoft External Staff Moderator
    2026-11-13T04:02:18.7266667+00:00

    Welcome Kei,

    Thanks for reaching out to Microsoft Q&A Forum. I understand that Windows 11 intermittently blocks your newly compiled C executable while debugging in Visual Studio Code.

    • Does the executable get blocked only when launched from VS Code’s integrated terminal, or does the same issue occur when running it directly from File Explorer?

    Please make sure you already tried the Q&A Assist steps. In addition, please try the following:

    1, Check Windows Security Protection History.

    • Open Windows Security.
    • Select Virus & threat protection.
    • Open Protection history.
    • Check whether Windows Defender Antivirus or another security component has quarantined or blocked the executable.

    2, Check Microsoft Defender Antivirus detection details.

    • Look for the detection name and affected file.
    • If the file was quarantined, verify that it is your own compiled executable before considering any restore action.

    3, Verify the executable’s location and build output.

    • Confirm that VS Code is launching the latest compiled version.
    • Check whether your build process generates the executable in a different directory or overwrites an existing file.

    Looking forward to your update.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.