The easiest way to do this is to use PowerShell from CMD with elevated privileges (for example, using a balrobic answer ), but you can also use PowerShell environment variables to simplify your life; eg:
powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath $ENV:USERPROFILE\Downloads
which will add the current user downloads folder, for example. C: \ Users \ Susana \ Downloads.
To get a list of the environment variables provided by PowerShell, you can use this PowerShell command:
Get-ChildItem Env: | Sort Name
As you can see, there is a windir variable. They can use this in addition to the subfolders you specify.
source share