.. So you want Defender to stop eating your files in a clean install, well here is the quick fix
IMPORTANT NOTE = Those are single ' not " in the cmd line!
To add a drive to Windows Defender exclusions using the command line, open PowerShell as administrator and use the Add-MpPreference cmdlet with the -ExclusionPath parameter, specifying the full drive letter path you want to exclude; for example, Add-MpPreference -ExclusionPath 'D:\' would exclude the entire D drive from scans.
Key points:
Here is the 2 paths I use in my .cmd, 1 is a repeat for all my drives, the last is for dControl.exe
THIS is drives only which is awesome, add more drives with each line
For a specific file ( like DefenderControl.exe )
Have Fun!
IMPORTANT NOTE = Those are single ' not " in the cmd line!
To add a drive to Windows Defender exclusions using the command line, open PowerShell as administrator and use the Add-MpPreference cmdlet with the -ExclusionPath parameter, specifying the full drive letter path you want to exclude; for example, Add-MpPreference -ExclusionPath 'D:\' would exclude the entire D drive from scans.
Key points:
- Command: Add-MpPreference -ExclusionPath '<drive_letter>:\'
- Example: Add-MpPreference -ExclusionPath 'D:\'
Here is the 2 paths I use in my .cmd, 1 is a repeat for all my drives, the last is for dControl.exe
THIS is drives only which is awesome, add more drives with each line
Code:
powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath 'C:\' -Force
powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath 'D:\' -Force
powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath 'E:\' -Force
powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionPath 'F:\' -Force
For a specific file ( like DefenderControl.exe )
Code:
powershell -inputformat none -outputformat none -NonInteractive -Command Add-MpPreference -ExclusionProcess 'dControl.exe' -Force
Have Fun!
Last edited: