Hello Kavya,
The error indicates that Windows Application Control is blocking your GCC-generated .exe files. This is not necessarily an issue with VS Code or the GCC compiler itself. An application control policy may be preventing the generated executable from running.
1. Check the Code Integrity event log
- Press
Win + R, typeeventvwr.msc, and press Enter.
Navigate to Applications and Services Logs > Microsoft > Windows > CodeIntegrity > Operational.
Look for Event ID 3077, then open it and check the General tab for the blocked executable path and policy information.
Event ID 3077 indicates that an enforced App Control policy blocked the file. Event ID 3076 indicates that the policy is in audit mode and would have blocked it.
2. Check whether the computer is organization-managed
Go to Settings > Accounts > Access work or school.
If your university manages the device, its IT administrator may have deployed the application control policy. In that case, ask the administrator to review the restriction and authorize your development tools, such as your coding folder or GCC/MinGW executables.
3. Check other Windows application restrictions
If this is your personal computer, check:
Windows Security > App & browser control > Smart App Control.
Settings > System > About to check your Windows edition.
Settings > System > Activation to check whether Windows is running in S mode.
4. Check AppLocker
In Event Viewer, navigate to Applications and Services Logs > Microsoft > Windows > AppLocker > EXE and DLL.
Look for Event ID 8004, which indicates that AppLocker blocked an executable.
5. Continue practicing while troubleshooting
If permitted by your university, you can use an online C compiler, GitHub Codespaces, or Windows Subsystem for Linux (WSL) while the restriction is being investigated.
Avoid disabling Device Guard or other security protections just to run the executables. First identify the enforcing policy and have the appropriate administrator authorize the required applications.
For additional information, see Microsoft's documentation:
If this answer resolves your issue, please consider accepting it as the answer and giving it an upvote. This helps other community members find the solution more easily.
Regards,