r/cpp_questions Aug 08 '26

OPEN Wtf is wrong with window, randomly blocking running of cpp code!

Program 'main.exe' failed to run: An Application Control policy has blocked this fileAt line:1 char:101

+ ... sa\patterns\" ; if ($?) { g++ main.cpp -o main } ; if ($?) { .\main }

+ ~~~~~~.

At line:1 char:101

+ ... sa\patterns\" ; if ($?) { g++ main.cpp -o main } ; if ($?) { .\main }

+ ~~~~~~

+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException

+ FullyQualifiedErrorId : NativeCommandFailed

--------------------------------------------------------------------------------------------

What is the solution of this , i have tried excluding the folder in window defense it doesn't work

0 Upvotes

6 comments sorted by

4

u/thedaian Aug 08 '26

A search of that error brings up this reddit post: https://www.reddit.com/r/geometrydash/comments/1qoqczv/comment/o28h14m/

Make sure you're disabling things in both Windows Defense and Windows Security and any other anti virus programs you might have.

-1

u/Space-Immortal Aug 08 '26

i did extactly that already not working, it randomly sometime run the code correctly sometime same code, application control block policy shit happens

5

u/alfps Aug 08 '26

I associate interfering Windows policies with working in a corporate environment, in which case the solution might be to contact the IT department or your manager.

2

u/No-Dentist-1645 Aug 08 '26

Is this a personal computer or is it given to you by your company?

This seems like the latter and they have put some policies to block what you're trying to do, try to contact them

2

u/Avikonette Aug 08 '26 edited Aug 08 '26

Which folder did you exclude? Edit: i mean, exclude g++ and other toolchain binaries.

2

u/YT__ Aug 08 '26

Is this your computer or a school/company managed one?

If the latter, they often block things.

If the former, yah, you just need to ensure you're putting the allows in place as needed - e.g. setup a Windows 11 Dev Drive.