Disable Defender Antivirus antimalware engine
- Single actionThis page belongs to a script, containing basic changes to achieve a task.
- Windows onlyThis script improves your privacy on Windows
- Impact: HighSystem Functionality Loss Risk: High
This action improves privacy with high impact when you run the recommended script. - Batch (batchfile)These changes use Windows system commands to update your settings.
- Fully reversible
You can fully restore this action (revert back to the original behavior) using this website.
The restore/revert methods provided here can help you fix issues.
Overview
This script disables Defender's main virus-scanning component (MpEngine.dll
).
Microsoft refers to this component as Microsoft Malware Protection Engine 1 2 3 4 5. This is a core component of Defender Antivirus 1 4 6 7. It is enabled by default on Windows 8. It scans, detects, and removes malware using Microsoft's antivirus technology 1.
The engine monitors system activity by:
- Scanning files 9 10 11 12 13 14, memory 7, emails 8, and web downloads 8
- Analyzing system processes and registry keys 5
- Tracking network activity 14
- Collecting system data for analysis 10 and logging events 15
- Scanning compressed files like RAR archives 11 12
- Running files in a virtual sandbox environment 7 11 16 called Defender Emulator 11
Disabling this component increases your privacy by:
- Reducing system monitoring and data collection
- Preventing forensic analysis of your files and system activity 10 13
- Stopping the creation of event logs 15, scan logs 10 and file caches 10
- Eliminating potential security risks from the engine's vulnerabilities 1 11 17
However, this script may reduce your security since your system will no longer detect or protect against viruses and other malicious software.
This action may lower your system's security by disabling virus detection and protection.
Technical Details
The engine (MpEngine.dll
) is loaded by MpSvc.dll
9 and works as part of MsMpEng.exe
9.
It is located in these paths:
Path | Confirmed versions with tests |
---|---|
%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\Default\MpEngine.dll 2 3 18 | Windows 10 Pro (≥ 22H2) and Windows 11 Pro (≥ 21H2) |
%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\{<GUID>} 2 3 | Windows 11 Pro (≥ 22H2) |
%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\StableEngineEtwLocation\mpengine_etw.dll 15 | Windows 11 Pro (≥ 21H2) |
- Not Advised
This script should only be used by advanced users.
This script is not recommended for daily use as it breaks important functionality.
Consider creating a system restore point before doing any changes.
- Security Trade-off
This action prioritizes privacy over certain security features. It's not recommended and should only be used by advanced users after understanding its implications.
Increased Privacy
Enhanced privacy through reduced data collection and trackingDecreased Security
Some security features will be disabled or limitedThis script can be reversed, this allows you to restore the default system security.
Sources
- Microsoft Out-Of-Band Security Update Patches Malware Protection Engine Flaw. www.bleepingcomputer.com. (2024).
Original: https://www.bleepingcomputer.com/news/security/microsoft-out-of-band-security-update-patches-malware-protection-engine-flaw
Archived: https://archive.ph/2024.10.28-130839/https://www.bleepingcomputer.com/news/security/microsoft-out-of-band-security-update-patches-malware-protection-engine-flaw/ - Variants of mpengine.dll. systemexplorer.net. (2024).
Original: https://systemexplorer.net/file-database/file-variants/mpengine-dll
Archived: https://archive.ph/2024.10.28-130959/https://systemexplorer.net/file-database/file-variants/mpengine-dll - What is mpengine.dll? Microsoft Malware Protection Engine File Information. ID:0246526. windowfin.com. (2024).
Original: http://windowfin.com/bbs/board.php
Archived: https://archive.ph/2024.10.28-131119/http://windowfin.com/bbs/board.php?bo_table=windowfin&wr_id=246526 - Microsoft Security Advisory 4022344. Microsoft Learn. learn.microsoft.com. (2024).
Original: https://learn.microsoft.com/en-us/security-updates/securityadvisories/2017/4022344
Archived: https://archive.ph/2024.10.28-131238/https://learn.microsoft.com/en-us/security-updates/securityadvisories/2017/4022344 - Description of Forefront endpoint security definition updates - Microsoft Support. support.microsoft.com. (2024).
Original: https://support.microsoft.com/en-us/topic/description-of-forefront-endpoint-security-definition-updates-b0833c24-fab3-390b-820b-3835beeb03b3
Archived: https://archive.ph/2024.10.28-131408/https://support.microsoft.com/en-us/topic/description-of-forefront-endpoint-security-definition-updates-b0833c24-fab3-390b-820b-3835beeb03b3 - Virus Bulletin :: Windows Defender under the microscope: a reverse engineer's perspective. virusbulletin.com. (2024).
Original: https://www.virusbulletin.com/conference/vb2018/abstracts/windows-defender-under-microscope-reverse-engineers-perspective
Archived: https://archive.ph/2024.10.28-131542/https://www.virusbulletin.com/conference/vb2018/abstracts/windows-defender-under-microscope-reverse-engineers-perspective - Windows Defender Memory Scan Feature Analysis. readmedium.com. (2024).
Original: https://readmedium.com/windows-defender-memory-scan-feature-analysis-3f9242f00132
Archived: https://archive.ph/2024.10.27-175254/https://readmedium.com/windows-defender-memory-scan-feature-analysis-3f9242f00132 - Web Isolation - Symantec Enterprise. community.broadcom.com. (2024).
Original: https://community.broadcom.com/symantecenterprise/communities/community-home/librarydocuments/viewdocument
Archived: https://archive.ph/2024.10.28-131709/https://community.broadcom.com/symantecenterprise/communities/community-home/librarydocuments/viewdocument?DocumentKey=f49b2ef7-244f-451d-85a5-0ca2ab01bf26&CommunityKey=a9b005c5-dc3c-4b04-9a1a-41efdafc2a35&tab=librarydocuments - An unexpected journey into Microsoft Defender's signature World — retooling_. retooling.io. (2024).
Original: https://retooling.io/blog/an-unexpected-journey-into-microsoft-defenders-signature-world
Archived: https://web.archive.org/web/20240930174756/https://retooling.io/blog/an-unexpected-journey-into-microsoft-defenders-signature-world - Microsoft security essentials -. forensics.wiki. (2024).
Original: https://forensics.wiki/microsoft_security_essentials
Archived: https://archive.ph/2024.10.28-131842/https://forensics.wiki/microsoft_security_essentials/ - Exploiting the Windows Defender `AsProtect` Heap Overflow Vulnerability. PixiePoint Security. www.pixiepointsecurity.com. (2024).
Original: https://www.pixiepointsecurity.com/blog/nday-cve-2021-31985
Archived: https://archive.ph/2024.10.28-132014/https://www.pixiepointsecurity.com/blog/nday-cve-2021-31985/ - mpengine contains unrar code forked from unrar prior to 5.0, introduces new bug while fixing others [42450597] - Project Zero. project-zero.issues.chromium.org. (2024).
Original: https://project-zero.issues.chromium.org/issues/42450597
Archived: https://archive.ph/2024.10.28-132144/https://project-zero.issues.chromium.org/issues/42450597 - Reverse, Reveal, Recover: Windows Defender Quarantine Forensics – Fox-IT International blog. blog.fox-it.com. (2024).
Original: https://blog.fox-it.com/2023/12/14/reverse-reveal-recover-windows-defender-quarantine-forensics
Archived: https://archive.ph/2024.10.28-132232/https://blog.fox-it.com/2023/12/14/reverse-reveal-recover-windows-defender-quarantine-forensics/ - Critical Microsoft Scripting Engine Memory Corruption Vulnerability. cert.europa.eu. (2024).
Original: https://cert.europa.eu/static/security-advisories/CERT-EU-SA2017-011.pdf
Archived: https://web.archive.org/web/20240802070249/https://cert.europa.eu/static/security-advisories/CERT-EU-SA2017-011.pdf - winevt-kb/docs/sources/eventlog-providers/Provider-Microsoft-Antimalware-Engine.md at main · privacysexy-forks/winevt-kb. github.com. (2024).
Original: https://github.com/privacysexy-forks/winevt-kb/blob/main/docs/sources/eventlog-providers/Provider-Microsoft-Antimalware-Engine.md
Archived: https://archive.ph/2024.10.29-183440/https://github.com/privacysexy-forks/winevt-kb/blob/main/docs/sources/eventlog-providers/Provider-Microsoft-Antimalware-Engine.md - rapid7-whitepaper-metasploit-framework-encapsulating-av-techniques.pdf. Encapsulating Antivirus (AV) Evasion Techniques in Metasploit Framework. Wei Chen. www.rapid7.com. (2024).
Original: https://www.rapid7.com/globalassets/_pdfs/whitepaperguide/rapid7-whitepaper-metasploit-framework-encapsulating-av-techniques.pdf
Archived: https://web.archive.org/web/20240921120228/https://www.rapid7.com/globalassets/_pdfs/whitepaperguide/rapid7-whitepaper-metasploit-framework-encapsulating-av-techniques.pdf - NVD - Results. nvd.nist.gov. (2024).
Original: https://nvd.nist.gov/vuln/search/results
Archived: https://archive.ph/2024.10.28-132953/https://nvd.nist.gov/vuln/search/results?form_type=Advanced&results_type=overview&isCpeNameSearch=true&seach_type=all&query=cpe:2.3:a:microsoft:malware_protection_engine:-:*:*:*:*:*:*:* - nickel-x64/WinSxS/Manifests/amd64_windows-defender-am-engine_31bf3856ad364e35_10.0.22621.1_none_60c1274fa9ff3325.manifest at b3f8c9549e49f2a92b401b3809b210d5f78190ba · colorsci/nickel-x64. raw.githubusercontent.com. (2024).
Original: https://raw.githubusercontent.com/privacysexy-forks/nickel-x64/b3f8c9549e49f2a92b401b3809b210d5f78190ba/WinSxS/Manifests/amd64_windows-defender-am-engine_31bf3856ad364e35_10.0.22621.1_none_60c1274fa9ff3325.manifest
Archived: https://archive.ph/2024.10.29-184854/https://raw.githubusercontent.com/privacysexy-forks/nickel-x64/b3f8c9549e49f2a92b401b3809b210d5f78190ba/WinSxS/Manifests/amd64_windows-defender-am-engine_31bf3856ad364e35_10.0.22621.1_none_60c1274fa9ff3325.manifest
Apply Now
Choose one of three ways to apply:
Download script
Download and run the script directly- No app needed
- Offline usage
- Easy-to-apply
- Free
- Open-source
Help
How to apply or restore "Disable Defender Antivirus antimalware engine" using script
- ≈ 2 min to complete
- Tools: Web Browser
- Difficulty: Simple
- ≈ 5 instructions
- 1
Download
Download the script file by clicking on thebutton above.
Use button above to restore changes. - 2
Keep the file
If warned by your browser, keep the file. - 3
Open
Open the downloaded file. - 4
Exit
Once it's done, press any key to exit the window. - 5
Restart
Restart your computer for all changes to take effect.
Apply with privacy.sexy
Guided, automated application with safety checks- Recommended for most users
- Includes safety checks
- Free
- Open-source
- Popular
- Offline/Online usage
Help
How to apply or restore "Disable Defender Antivirus antimalware engine" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2
Choose script
- Search for the script name: Disable Defender Antivirus antimalware engine
- Check the script by clicking on the checkbox.
- 3
Run
Click on ▶️ Run button at the bottom of the page.This button only appears on desktop version (recommended). On browser, use 💾 Save button.
- Apply
- Revert
:: Soft delete files matching pattern: "%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\Default\MpEngine.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 = "^""%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\Default\MpEngine.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"
:: Soft delete files matching pattern: "%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\{*}\mpengine.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 = "^""%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\{*}\mpengine.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"
:: Soft delete files matching pattern: "%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\StableEngineEtwLocation\mpengine_etw.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 = "^""%PROGRAMDATA%\Microsoft\Windows Defender\Definition Updates\StableEngineEtwLocation\mpengine_etw.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"
Ijo6IFJlc3Rvcm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tcy5cIl5cIlwiJytcIl5cIlwiYHJgblwiXlwiXCIrJ30nK1wiXlwiXCJgcmBuXCJeXCJcIisnaWYgKCRmYWlsZWRDb3VudCAtZ3QgMCkgeycrXCJeXCJcImByYG5cIl5cIlwiKycgICAgV3JpdGUtV2FybmluZyBcIl5cIlwiRmFpbGVkIHRvIHByb2Nlc3MgJCgkZmFpbGVkQ291bnQpIGl0ZW1zLlwiXlwiXCInK1wiXlwiXCJgcmBuXCJeXCJcIisnfScrXCJeXCJcImByYG5cIl5cIlwiKycnOyBJbnZva2UtQXNUcnVzdGVkSW5zdGFsbGVyICRjbWRcIiI=
Help
How to apply or restore "Disable Defender Antivirus antimalware engine" using commands
- ≈ 2 min to complete
- Tools: Command Prompt
- Difficulty: Medium
- ≈ 3 instructions
- 1
Open Command Prompt
Open Command Prompt as Administrator. - 2
Copy code
Copy the code: - 3
Paste & run
Paste the commands into Command Prompt and press Enter to run.Some changes require a system restart to take effect
Similar Guides
Wider Goal
Guides below includes this guide to achieve a wider goal.See other more general settings that includes this one as one of its actions.These plans combine multiple privacy settings, including this one, for stronger protection.
- Disable Defender Antivirus service
- Disable Defender services and drivers
- Disable Defender Antivirus
- Disable Defender
- Privacy over security
This category disables the Defender Antivirus service and its related components. This service is also referred to as Microsoft Defender Antivirus Servic...
This category provides scripts to disable Defender Antivirus. Defender Antivirus, integrated into Windows, provides protection against viruses, ransomwar...
This category offers scripts to disable Windows security components related to Defender. Defender is also referred to as Microsoft Defender or Windows De...
Same Goal
Other guides in Disable Defender Antivirus service See settings that are in the same category as this guide.Using other actions in the same category may help you achieve your goal better.
See all 10 guides
About the Creators
These people have authored this documentation and written its scripts:
Reviewed By
This guide has undergone comprehensive auditing and peer review:Expert review by undergroundwires
- Verified technical accuracy and editorial standards
- Assessed system impact and user privacy risks
- Audited and verified using automated security tests
Public review by large community
- Privacy enthusiasts and professionals peer-reviewed
- Millions of end-users tested across different environments
- Audited and verified using third-party security software
History
We continually monitor our guides, their impact and other potential privacy options. We update our guides when new information becomes available. On every update, we publicly store who made the change, what has been changed, why the change was made and when the change was made.