WesternGun
WesternGun

Reputation: 12738

Gradle downloads triggers Windows Defender - how can I exclude files downloaded in Temp folder

When I use Gradle, Windows Defender keeps popping up and want to send the files to their server. The download file has this pattern:

%USERPROFILE%\AppData\Local\Temp\gradle_downloadxxxxxxxxxxxxxxxxxxxxxxxxbin

Can I exclude them with file mask? I don't see it in the settings of Windows Defender.

I don't want to exclude the whole folder because I want other downloaded files to be scanned.

Upvotes: 3

Views: 1928

Answers (1)

WesternGun
WesternGun

Reputation: 12738

OK I have found this:

Windows Defender - Add exclusion folder programmatically

with elevated cmd, you can do:(change me to your username)

powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath "C:\Users\me\AppData\Local\Temp\gradle_download*"

And check Windows Defender settings, you will see your mask there. It is working now.

Upvotes: 3

Related Questions