Important: Please read the Qt Code of Conduct -

Windows: prevent Windows Defender from scanning my project's files

  • Hi,

    No doubt that many of you have come across that problem, i.e. build your Qt application on Windows and then realise that a fair amount of your CPU gets used by Windows Defender to scan your project's files.

    Well, yes, I know that I can add exclusions to Windows Defender, as explained here by Microsoft. So, I first added the folder for my project, but it didn't make any difference.

    Then, I came across another Microsoft page where they use Group Policies, but again to no avail.

    Finally, I came across this PowerShell script, to which I added the folders to my project and my copy of CMake, Ninja and clcache, but again to no avail.

    By no avail, I mean that if I build my project, then straightaway I see the Antimalware Service Executable process kicking in and using anywhere between 15% and 70% of my CPU.

    FWIW, I am using the very latest version of Window 10, i.e. 21H1, together with Visual Studio 2017 with CMake, Ninja, clcache and Qt 5.12.11.

    Cheers, Alan.

  • I would use this with caution as you are creating a potential security hole on your system. Configure and validate exclusions for Microsoft Defender Antivirus scans

  • Thanks a lot for the link @mchinand. (Yes, I know and fully appreciate that this can create potential security holes.)

  • Do it on the Qt install directory too. Otherwise when you update Qt it will take FOREVER.

Log in to reply