Disable Defender Antivirus service module
Overview
This script improves your privacy on Windows.
These changes use Windows system commands to update your settings.
This script disables MpSvc.dll
.
Microsoft refers to MpSvc.dll
as the Service Module 1 2.
It is part of Defender Antivirus service 3.
It manages essential Defender Antivirus functions, including:
- Scans: Monitors files in real-time, protects network, manages scans 4
- Updates: Downloads new virus definitions 4
- Threats: Finds and removes malware 4
- Telemetry: Collects and sends data to Microsoft 4
- Integrations: Works with Windows Security Center and antimalware scanning (AMSI) 4
- Restrictions: Prevents Defender Antivirus from being disabled 5
This script improves privacy by:
- Reducing data collection and reporting to Microsoft
- Preventing system monitoring 4
- Allowing more control over privacy-related settings, including the ability to disable Defender Antivirus 5
The script may improve system performance by:
- Reducing background scanning activities
- Decreasing memory usage
- Lowering CPU usage from real-time protection
Disabling MpSvc.dll
reduces potential attack vectors that have been exploited in REvil ransomware 6,
state-sponsored attacks 7, and the Clambing backdoor 8.
However, disabling it also impairs critical security functions such as real-time protection, security definition updates and threat detection capabilities.
Disabling this component may increase your computer's risk of viruses and other security threats.
Technical Details
Defender Antivirus service runs MsMpEng.exe
on modern versions of Windows 9.
MsMpEng.exe
loads this DLL 6 8 10 11.
This DLL activates core antivirus functions via MpEngine.dll
11 12.
It interacts with other applications using an ALPC port labeled IMpService
13.
Location on modern Windows:
Historical locations on older Windows versions:
%PROGRAMFILES64%\Windows Defender\mpsvc.dll
1%PROGRAMDATA%\Microsoft\Windows Defender\Platform\<version number>\MpSvc.dll
2 10%PROGRAMFILES\Microsoft Security Client\MpSvc.dll
2
This script uses Batch (batchfile) scripting language.
This script should only be used by advanced users. This script is not recommended for daily use as it breaks important functionality. Do not run it without having backups and system snapshots.
Implementation Details
-
Language: batch
-
Required Privileges: Administrator rights
-
Compatibility: Windows only
-
Reversibility: Can be undone using provided revert script
Explore Categories
- Disable Defender Antivirus service
- Disable Defender services and drivers
- Disable Defender Antivirus
- Disable Defender
- Privacy over security
This action belongs to Disable Defender Antivirus service category. This category disables the Defender Antivirus service and its related components. This service is also referred to as Microsoft Defender Antivirus Service and Windows Defender Service. It is a core component of Microsoft Defender Antivirus, essential for its operation. Using these... Read more on category page ▶
This action belongs to Disable Defender services and drivers category. This category configures Windows using 15 scripts. These scripts are organized in 1 categories. The category includes 4 subscripts and 1 subcategories that include more scripts and categories. Read more on category page ▶
This action belongs to Disable Defender Antivirus category. This category provides scripts to disable Defender Antivirus. Defender Antivirus, integrated into Windows, provides protection against viruses, ransomware, and other types of malware. Disabling Defender Antivirus may improve system performance and privacy by stopping related data collection... Read more on category page ▶
This action belongs to Disable Defender category. This category offers scripts to disable Windows security components related to Defender. Defender is also referred to as Microsoft Defender or Windows Defender. Although designed to protect you, its features may compromise your privacy and decrease computer performance. Privacy concerns... Read more on category page ▶
This action belongs to Privacy over security category. This category configures Windows using 254 scripts. These scripts are organized in 57 categories. The category includes 3 subcategories that include more scripts and categories. Read more on category page ▶
Apply now
Choose one of three ways to apply:
- Automatically via privacy.sexy: The easiest and safest option.
- Manually by downloading: Requires downloading a file.
- Manually by copying: Advanced flexibility.
Alternative 1. Apply with Privacy.sexy
privacy.sexy is free and open-source application that lets securely apply this action easily.
You can fully restore this action (revert back to the original behavior) using the application.
privacy.sexy instructions
- Open or download the desktop application
- Search for the script name:
Disable Defender Antivirus service module
. - Check the script by clicking on the checkbox.
- Click on Run button at the bottom of the page.
Alternative 2. Download
This script is irreversible, meaning there is no straightforward method to restore changes once applied. Exercise caution before running, restoring it may not be possible.
-
Download the script file by clicking on the button below:
-
Run the script file by clicking on it.
Download revert script
This file restores your system to its original state, before this script is applied.
Alternative 3. Copy
This is for advanced users. Consider automatically applying or downloading the script for simpler way.
- Open Command Prompt as administrator.
HELP: Step-by-step guide
-
Click on Start menu
- Windows 11
- Windows 10
-
Type cmd
- Windows 11
- Windows 10
-
Right click on Command Prompt select Run as administrator
- Windows 11
- Windows 10
-
Click on Yes to run Command Prompt
- Windows 11
- Windows 10
- Windows 11
- Windows 10
- Copy the following code:
:: Soft delete files matching pattern: "%PROGRAMFILES%\Windows Defender\MpSvc.dll" as TrustedInstaller
PowerShell -ExecutionPolicy Unrestricted -Command "function Invoke-AsTrustedInstaller($Script) { $principalSid = [System.Security.Principal.SecurityIdentifier]::new('S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464'); $principalName = $principalSid.Translate([System.Security.Principal.NTAccount]); $streamFile = New-TemporaryFile; $scriptFile = New-TemporaryFile; try { $scriptFile = Rename-Item -LiteralPath $scriptFile -NewName ($scriptFile.BaseName + '.ps1') -Force -PassThru; $Script | Out-File $scriptFile -Encoding UTF8; $taskName = "^""privacy$([char]0x002E)sexy invoke"^""; schtasks.exe /delete /tn $taskName /f 2>&1 | Out-Null; $executionCommand = "^""powershell.exe -ExecutionPolicy Bypass -File '$scriptFile' *>&1 | Out-File -FilePath '$streamFile' -Encoding UTF8"^""; $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "^""-ExecutionPolicy Bypass -Command `"^""$executionCommand`"^"""^""; $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries; Register-ScheduledTask -TaskName $taskName -Action $action -Settings $settings -Force -ErrorAction Stop | Out-Null; try { ($scheduleService = New-Object -ComObject Schedule.Service).Connect(); $scheduleService.GetFolder('\').GetTask($taskName).RunEx($null, 0, 0, $principalName) | Out-Null; $timeout = (Get-Date).AddMinutes(5); Write-Host "^""Running as $principalName"^""; while ((Get-ScheduledTaskInfo $taskName).LastTaskResult -eq 267009) { Start-Sleep -Milliseconds 200; if ((Get-Date) -gt $timeout) { Write-Warning 'Skipping: Timeout'; break; }; }; if (($result = (Get-ScheduledTaskInfo $taskName).LastTaskResult) -ne 0) { Write-Error "^""Failed, due to exit code: $result."^""; } } finally { schtasks.exe /delete /tn $taskName /f | Out-Null; }; Get-Content $streamFile } finally { Remove-Item $streamFile, $scriptFile; }; }; $cmd = '$pathGlobPattern = "^""%PROGRAMFILES%\Windows Defender\MpSvc.dll"^""'+"^""`r`n"^""+'$expandedPath = [System.Environment]::ExpandEnvironmentVariables($pathGlobPattern)'+"^""`r`n"^""+'Write-Host "^""Searching for items matching pattern: `"^""$($expandedPath)`"^""."^""'+"^""`r`n"^""+''+"^""`r`n"^""+'$renamedCount = 0'+"^""`r`n"^""+'$skippedCount = 0'+"^""`r`n"^""+'$failedCount = 0'+"^""`r`n"^""+''+"^""`r`n"^""+'$foundAbsolutePaths = @()'+"^""`r`n"^""+''+"^""`r`n"^""+'try {'+"^""`r`n"^""+' $foundAbsolutePaths += @('+"^""`r`n"^""+' Get-Item -Path $expandedPath -ErrorAction Stop | Select-Object -ExpandProperty FullName'+"^""`r`n"^""+' )'+"^""`r`n"^""+'} catch [System.Management.Automation.ItemNotFoundException] {'+"^""`r`n"^""+' <# Swallow, do not run `Test-Path` before, it''s unreliable for globs requiring extra permissions #>'+"^""`r`n"^""+'}'+"^""`r`n"^""+'$foundAbsolutePaths = $foundAbsolutePaths `'+"^""`r`n"^""+' | Select-Object -Unique `'+"^""`r`n"^""+' | Sort-Object -Property { $_.Length } -Descending'+"^""`r`n"^""+'if (!$foundAbsolutePaths) {'+"^""`r`n"^""+' Write-Host ''Skipping, no items available.'''+"^""`r`n"^""+' exit 0'+"^""`r`n"^""+'}'+"^""`r`n"^""+'Write-Host "^""Initiating processing of $($foundAbsolutePaths.Count) items from `"^""$expandedPath`"^""."^""'+"^""`r`n"^""+'foreach ($path in $foundAbsolutePaths) {'+"^""`r`n"^""+' if (Test-Path -Path $path -PathType Container) {'+"^""`r`n"^""+' Write-Host "^""Skipping folder (not its contents): `"^""$path`"^""."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' continue'+"^""`r`n"^""+'}'+"^""`r`n"^""+'if($revert -eq $true) {'+"^""`r`n"^""+' if (-not $path.EndsWith(''.OLD'')) {'+"^""`r`n"^""+' Write-Host "^""Skipping non-backup file: `"^""$path`"^""."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' continue'+"^""`r`n"^""+' }'+"^""`r`n"^""+'} else {'+"^""`r`n"^""+' if ($path.EndsWith(''.OLD'')) {'+"^""`r`n"^""+' Write-Host "^""Skipping backup file: `"^""$path`"^""."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' continue'+"^""`r`n"^""+' }'+"^""`r`n"^""+'}'+"^""`r`n"^""+'$originalFilePath = $path'+"^""`r`n"^""+'Write-Host "^""Processing file: `"^""$originalFilePath`"^""."^""'+"^""`r`n"^""+'if (-Not (Test-Path $originalFilePath)) {'+"^""`r`n"^""+' Write-Host "^""Skipping, file `"^""$originalFilePath`"^"" not found."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' exit 0'+"^""`r`n"^""+'}'+"^""`r`n"^""+''+"^""`r`n"^""+'if ($revert -eq $true) {'+"^""`r`n"^""+' $newFilePath = $originalFilePath.Substring(0, $originalFilePath.Length - 4)'+"^""`r`n"^""+'} else {'+"^""`r`n"^""+' $newFilePath = "^""$($originalFilePath).OLD"^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+'try {'+"^""`r`n"^""+' Move-Item -LiteralPath "^""$($originalFilePath)"^"" -Destination "^""$newFilePath"^"" -Force -ErrorAction Stop'+"^""`r`n"^""+' Write-Host "^""Successfully processed `"^""$originalFilePath`"^""."^""'+"^""`r`n"^""+' $renamedCount++'+"^""`r`n"^""+' '+"^""`r`n"^""+'} catch {'+"^""`r`n"^""+' Write-Error "^""Failed to rename `"^""$originalFilePath`"^"" to `"^""$newFilePath`"^"": $($_.Exception.Message)"^""'+"^""`r`n"^""+' $failedCount++'+"^""`r`n"^""+' '+"^""`r`n"^""+'}'+"^""`r`n"^""+'}'+"^""`r`n"^""+'if (($renamedCount -gt 0) -or ($skippedCount -gt 0)) {'+"^""`r`n"^""+' Write-Host "^""Successfully processed $renamedCount items and skipped $skippedCount items."^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+'if ($failedCount -gt 0) {'+"^""`r`n"^""+' Write-Warning "^""Failed to process $($failedCount) items."^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+''; Invoke-AsTrustedInstaller $cmd"
- Right click on command prompt to paste it.
- Press Enter to apply remaining code.
Copy restore code
Copy and run the following code to restore changes:
:: Restore files matching pattern: "%PROGRAMFILES%\Windows Defender\MpSvc.dll" as TrustedInstaller
PowerShell -ExecutionPolicy Unrestricted -Command "function Invoke-AsTrustedInstaller($Script) { $principalSid = [System.Security.Principal.SecurityIdentifier]::new('S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464'); $principalName = $principalSid.Translate([System.Security.Principal.NTAccount]); $streamFile = New-TemporaryFile; $scriptFile = New-TemporaryFile; try { $scriptFile = Rename-Item -LiteralPath $scriptFile -NewName ($scriptFile.BaseName + '.ps1') -Force -PassThru; $Script | Out-File $scriptFile -Encoding UTF8; $taskName = "^""privacy$([char]0x002E)sexy invoke"^""; schtasks.exe /delete /tn $taskName /f 2>&1 | Out-Null; $executionCommand = "^""powershell.exe -ExecutionPolicy Bypass -File '$scriptFile' *>&1 | Out-File -FilePath '$streamFile' -Encoding UTF8"^""; $action = New-ScheduledTaskAction -Execute 'powershell.exe' -Argument "^""-ExecutionPolicy Bypass -Command `"^""$executionCommand`"^"""^""; $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries; Register-ScheduledTask -TaskName $taskName -Action $action -Settings $settings -Force -ErrorAction Stop | Out-Null; try { ($scheduleService = New-Object -ComObject Schedule.Service).Connect(); $scheduleService.GetFolder('\').GetTask($taskName).RunEx($null, 0, 0, $principalName) | Out-Null; $timeout = (Get-Date).AddMinutes(5); Write-Host "^""Running as $principalName"^""; while ((Get-ScheduledTaskInfo $taskName).LastTaskResult -eq 267009) { Start-Sleep -Milliseconds 200; if ((Get-Date) -gt $timeout) { Write-Warning 'Skipping: Timeout'; break; }; }; if (($result = (Get-ScheduledTaskInfo $taskName).LastTaskResult) -ne 0) { Write-Error "^""Failed, due to exit code: $result."^""; } } finally { schtasks.exe /delete /tn $taskName /f | Out-Null; }; Get-Content $streamFile } finally { Remove-Item $streamFile, $scriptFile; }; }; $cmd = '$revert = $true'+"^""`r`n"^""+' $pathGlobPattern = "^""%PROGRAMFILES%\Windows Defender\MpSvc.dll.OLD"^""'+"^""`r`n"^""+' $expandedPath = [System.Environment]::ExpandEnvironmentVariables($pathGlobPattern)'+"^""`r`n"^""+' Write-Host "^""Searching for items matching pattern: `"^""$($expandedPath)`"^""."^""'+"^""`r`n"^""+' '+"^""`r`n"^""+'$renamedCount = 0'+"^""`r`n"^""+'$skippedCount = 0'+"^""`r`n"^""+'$failedCount = 0'+"^""`r`n"^""+''+"^""`r`n"^""+' $foundAbsolutePaths = @()'+"^""`r`n"^""+' '+"^""`r`n"^""+' try {'+"^""`r`n"^""+' $foundAbsolutePaths += @('+"^""`r`n"^""+' Get-Item -Path $expandedPath -ErrorAction Stop | Select-Object -ExpandProperty FullName'+"^""`r`n"^""+' )'+"^""`r`n"^""+' } catch [System.Management.Automation.ItemNotFoundException] {'+"^""`r`n"^""+' <# Swallow, do not run `Test-Path` before, it''s unreliable for globs requiring extra permissions #>'+"^""`r`n"^""+' }'+"^""`r`n"^""+' $foundAbsolutePaths = $foundAbsolutePaths `'+"^""`r`n"^""+' | Select-Object -Unique `'+"^""`r`n"^""+' | Sort-Object -Property { $_.Length } -Descending'+"^""`r`n"^""+' if (!$foundAbsolutePaths) {'+"^""`r`n"^""+' Write-Host ''Skipping, no items available.'''+"^""`r`n"^""+' exit 0'+"^""`r`n"^""+' }'+"^""`r`n"^""+' Write-Host "^""Initiating processing of $($foundAbsolutePaths.Count) items from `"^""$expandedPath`"^""."^""'+"^""`r`n"^""+' foreach ($path in $foundAbsolutePaths) {'+"^""`r`n"^""+' if (Test-Path -Path $path -PathType Container) {'+"^""`r`n"^""+' Write-Host "^""Skipping folder (not its contents): `"^""$path`"^""."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' continue'+"^""`r`n"^""+'}'+"^""`r`n"^""+'if($revert -eq $true) {'+"^""`r`n"^""+' if (-not $path.EndsWith(''.OLD'')) {'+"^""`r`n"^""+' Write-Host "^""Skipping non-backup file: `"^""$path`"^""."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' continue'+"^""`r`n"^""+' }'+"^""`r`n"^""+'} else {'+"^""`r`n"^""+' if ($path.EndsWith(''.OLD'')) {'+"^""`r`n"^""+' Write-Host "^""Skipping backup file: `"^""$path`"^""."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' continue'+"^""`r`n"^""+' }'+"^""`r`n"^""+'}'+"^""`r`n"^""+'$originalFilePath = $path'+"^""`r`n"^""+'Write-Host "^""Processing file: `"^""$originalFilePath`"^""."^""'+"^""`r`n"^""+'if (-Not (Test-Path $originalFilePath)) {'+"^""`r`n"^""+' Write-Host "^""Skipping, file `"^""$originalFilePath`"^"" not found."^""'+"^""`r`n"^""+' $skippedCount++'+"^""`r`n"^""+' exit 0'+"^""`r`n"^""+'}'+"^""`r`n"^""+''+"^""`r`n"^""+'if ($revert -eq $true) {'+"^""`r`n"^""+' $newFilePath = $originalFilePath.Substring(0, $originalFilePath.Length - 4)'+"^""`r`n"^""+'} else {'+"^""`r`n"^""+' $newFilePath = "^""$($originalFilePath).OLD"^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+'try {'+"^""`r`n"^""+' Move-Item -LiteralPath "^""$($originalFilePath)"^"" -Destination "^""$newFilePath"^"" -Force -ErrorAction Stop'+"^""`r`n"^""+' Write-Host "^""Successfully processed `"^""$originalFilePath`"^""."^""'+"^""`r`n"^""+' $renamedCount++'+"^""`r`n"^""+' '+"^""`r`n"^""+'} catch {'+"^""`r`n"^""+' Write-Error "^""Failed to rename `"^""$originalFilePath`"^"" to `"^""$newFilePath`"^"": $($_.Exception.Message)"^""'+"^""`r`n"^""+' $failedCount++'+"^""`r`n"^""+' '+"^""`r`n"^""+'}'+"^""`r`n"^""+' }'+"^""`r`n"^""+' if (($renamedCount -gt 0) -or ($skippedCount -gt 0)) {'+"^""`r`n"^""+' Write-Host "^""Successfully processed $renamedCount items and skipped $skippedCount items."^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+'if ($failedCount -gt 0) {'+"^""`r`n"^""+' Write-Warning "^""Failed to process $($failedCount) items."^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+''; Invoke-AsTrustedInstaller $cmd"
Support
This website relies on your support.
Your donation helps keep the project alive and improves its content ❤️.
Share this page: