question

KumudVerma-7813 avatar image
0 Votes"
KumudVerma-7813 asked RLWA32-6355 answered

Access Denied while running C++ code in Visual Studio Code

As i click on run code button of code runner extension of vsc
It create a .exe file which is deleted by mAcfee Antivirus 110084-screenshot-211.png


c++
screenshot-211.png (563.4 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Viorel-1 avatar image
0 Votes"
Viorel-1 answered RLWA32-6355 edited

Check the documentation of Antivirus about file and folder exceptions: https://www.bing.com/search?q=mcafee+exclusions. Add your a.exe file or folder to the list of of exclusions.

By the way, you can also use Visual Studio for such programs.


· 10
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

But previously it is working correctly and by adding a.exe to exclude item it removed from there when i run diffrent code as a.exe modified(written in mcafee antivirus as warning)


Basically i think it's a problem of vsc
these problem start when i am setting debugger for c++
Please some one suggest a way to correct it

0 Votes 0 ·

No, it's not a problem of VS. It's a problem of your McAfee antivirus.
Easiest solution: as Viorel already said, add your main project directory to the McAfee exclusions. Then all your projects will be excluded from virus check.
Another way to correct it: delete McAfee and use another antivirus.

1 Vote 1 ·

It seems unlikely to me that this is an antivirus problem. Ordinarily antivirus programs will quarantine an executable. This process removes the executable and moves it to the antivirus programs quarantine location. So if antivirus was involved I would not expect an access denied error. This error could be symptomatic of another process holding an open handle.

Edit:
Apparently the OP did receive a McAfee notification. Perhaps the access denied error occurred at the time that McAfee quarantined the executable.

0 Votes 0 ·
Show more comments

no it's also occure in quick heal
and on adding files on exception if any changes made on that file it come out of exception

0 Votes 0 ·
Show more comments
RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered

McAfee consumer products do not support folder exclusions. Other than removing McAfee another option is to disable real-time scanning during your development activities. Regarding folder exclusions, refer to excluding folder


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.