Portable Tool for an Ideal Windows Setup
C# activatorbloatware-removalcsharpdebloatdebloaterdisable-servicesmonitoring-systemportableprivacy-toolsregistry-tweakssystem-tuningsystem-utilitytelemetrytweakerwindows-10windows-11windows-debloatwindows-defenderwindows-optimizationwindows-tweaks
fix and restoration of Windows Defender parameters
Greedeksf2d57bbcba84
diff --git a/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.cs b/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.csindex b3ca2732..9de2f881 100644--- a/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.cs+++ b/.Source/GTweak/Utilities/Tweaks/DefenderManager/BackupRights.cs@@ -27,18 +27,43 @@ namespace GTweak.Utilities.Tweaks.DefenderManager{ @"SYSTEM\CurrentControlSet\Services\MsSecWfp", Registry.LocalMachine },{ @"SYSTEM\CurrentControlSet\Services\webthreatdefsvc", Registry.LocalMachine },{ @"SYSTEM\CurrentControlSet\Services\webthreatdefusersvc", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Control\CI", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Control\CI\Policy", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Control\CI\State", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Control\CI\Config", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Control\DeviceGuard", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity", Registry.LocalMachine },{ @"SOFTWARE\Microsoft\Windows Defender\Features", Registry.LocalMachine },{ @"SOFTWARE\Microsoft\Windows Defender\Exclusions", Registry.LocalMachine },- { @"SOFTWARE\Microsoft\Security Center", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Defender\Cloud", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Defender\CoreService", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Defender\Windows Defender\ControlledFolderAccess", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Defender\Windows Defender Exploit Guard", Registry.LocalMachine },{ @"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection", Registry.LocalMachine },{ @"SOFTWARE\Policies\Microsoft\Windows Defender\SpyNet", Registry.LocalMachine },- { @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", Registry.LocalMachine },- { @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Policy Manager", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\SmartScreen", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Reporting", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\UX Configuration", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Security Center", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows defender\CoreService", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Security Center", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications", Registry.LocalMachine },{ @"SOFTWARE\Policies\Microsoft\Windows\System", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost", Registry.LocalMachine },+ { @"Software\Microsoft\Windows\CurrentVersion\AppHost", Registry.CurrentUser },+ { @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter", Registry.LocalMachine },+ { @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run", Registry.LocalMachine },{ @"SOFTWARE\Policies\Microsoft\MRT", Registry.LocalMachine },- { @"SOFTWARE\Policies\Microsoft\Windows Defender\SmartScreen", Registry.LocalMachine },{ @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", Registry.LocalMachine },- { @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", Registry.LocalMachine },+ { @"SOFTWARE\Policies\Microsoft\Windows\WTDS", Registry.LocalMachine },{ @"SYSTEM\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger", Registry.LocalMachine },{ @"SYSTEM\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger", Registry.LocalMachine },{ @"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Windows Defender/Operational", Registry.LocalMachine },@@ -46,10 +71,15 @@ namespace GTweak.Utilities.Tweaks.DefenderManager{ @"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-DeviceConfidence/Analytic", Registry.LocalMachine },{ @"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-DeviceGuard/Operational", Registry.LocalMachine },{ @"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-DeviceGuard/Verbose", Registry.LocalMachine },- { @"SOFTWARE\Microsoft\Windows defender\CoreService", Registry.LocalMachine },- { @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard", Registry.LocalMachine },- { @"SOFTWARE\Microsoft\Windows Defender\Cloud", Registry.LocalMachine },+ { @"SOFTWARE\WOW6432Node\Policies\Microsoft\Windows Defender", Registry.LocalMachine },+ { @"CLSID\{09A47860-11B0-4DA5-AFA5-26D86198A780}", Registry.ClassesRoot },{ @"Software\Microsoft\Edge", Registry.CurrentUser },+ { @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\ASR", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Controlled Folder Access", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Network Protection", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Advanced Threat Protection", Registry.LocalMachine },+ { @"SOFTWARE\Microsoft\Windows Defender Security Center\Notifications", Registry.LocalMachine },};internal static void ExportRights()diff --git a/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs b/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.csindex 7468a40e..a4b7708f 100644--- a/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs+++ b/.Source/GTweak/Utilities/Tweaks/DefenderManager/WindowsDefender.cs@@ -29,8 +29,8 @@ namespace GTweak.Utilities.Tweaks.DefenderManager{ "WdNisDrv", "3" },{ "WdNisSvc", "3"},{ "webthreatdefsvc", "3" },- { "webthreatdefusersvc", "3" },- { "wscsvc", "3" }+ { "webthreatdefusersvc", "2" },+ { "wscsvc", "2" }};private static readonly (string Path, string Normal, string Block)[] fileMappings = new (string Path, string Normal, string Block)[]@@ -97,6 +97,8 @@ namespace GTweak.Utilities.Tweaks.DefenderManager@"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableScriptScanning /f & " +@"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableRawWriteNotification /f & " +@"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableIntrusionPreventionSystem /f & " ++ @"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableInformationProtectionControl /f & " ++ @"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v RealtimeScanDirection /t REG_DWORD /f & " +@"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableArchiveScanning /f & " +@"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v SignatureDisableUpdateOnStartupWithoutEngine /f & " +@"reg delete ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisablePrivacyMode /f & " +@@ -116,14 +118,15 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerRegistryHelp.CreateFolder(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer");RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer", "SmartScreenEnabled", "On", RegistryValueKind.String);RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\System", "EnableSmartScreen");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Policy Manager");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\MpEngine");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SmartScreen");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Real-Time Protection");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\Reportin");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\SpyNet");- RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Policy Manager");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\SmartScreen");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Reporting");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\SpyNet");+ RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\UX Configuration");RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center");RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware");RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates");@@ -146,11 +149,19 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerRegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Cloud", "DisableBlockAtFirstSeen");RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Cloud", "CaptureBetaFeatures");+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Policies\Microsoft\Windows Defender", "DisableRoutinelyTakingAction", 0, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Policy", "VerifiedAndReputablePolicyState", 1, RegistryValueKind.DWord);+RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\MicrosoftEdge\PhishingFilter");RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "VulnerableDriverBlocklistEnable", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"System\CurrentControlSet\Control\CI\State", "HVCIEnabled", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "EnabledV9", 1, RegistryValueKind.DWord);RegistryHelp.DeleteFolderTree(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\WTDS");- RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity", "Enabled", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard", "EnableVirtualizationBasedSecurity", 1, RegistryValueKind.DWord);+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity", "Enabled");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard", "EnableVirtualizationBasedSecurity");++RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost", "EnableWebContentEvaluation");RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost", "PreventOverride");RegistryHelp.CreateFolder(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");@@ -168,16 +179,13 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerManageExclusions(false);CommandExecutor.RunCommandAsTrustedInstaller($@"{PathLocator.Executable.NSudo} -U:T -P:E -ShowWindowMode:Hide -Wait cmd /c " +- @"reg add HKLM\SYSTEM\CurrentControlSet\Services\WinDefend /v AutorunsDisabled /t REG_DWORD /d 0 /f & " +- @"reg add HKLM\SYSTEM\CurrentControlSet\Services\wscsvc /v DelayedAutoStart /t REG_DWORD /d 0 /f & " ++ @"reg delete HKLM\SYSTEM\CurrentControlSet\Services\WinDefend /v AutorunsDisabled /f & " ++ @"reg add HKLM\SYSTEM\CurrentControlSet\Services\wscsvc /v DelayedAutoStart /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SYSTEM\CurrentControlSet\Services\WdFilter\Instances\WdFilter Instance"" /v Altitude /t REG_SZ /d 328010 /f & " +$"for /d %D in (\"{Path.Combine(PathLocator.Folders.SystemDrive, @"ProgramData\\Microsoft\\Windows Defender\\Platform\\*")}\") do if exist \"%D\\BlockAntimalware.exe\" ren \"%D\\BlockAntimalware.exe\" MsMpEng.exe & " +$"for /d %D in (\"{Path.Combine(PathLocator.Folders.SystemDrive, @"ProgramData\\Microsoft\\Windows Defender\\Platform\\*")}\") do if exist \"%D\\BlockAntimalwareCore.exe\" ren \"%D\\BlockAntimalwareCore.exe\" MpDefenderCoreService.exe & " +@"reg delete ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v DisableBlockAtFirstSeen /f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows Defender\Windows Defender\ControlledFolderAccess"" /v Enable /t REG_DWORD /d 1 /f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\ASR"" /v EnableASRConsumers /t REG_DWORD /d 1/f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Controlled Folder Access"" /v EnableControlledFolderAccess /t REG_DWORD /d 1 /f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Network Protection"" /v EnableNetworkProtection /t REG_DWORD /d 1 /f & " ++ @"reg delete ""HKLM\SOFTWARE\Microsoft\Windows Defender\Windows Defender\ControlledFolderAccess"" /v Enable /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\CoreService"" /v DisableCoreService1DSTelemetry /t REG_DWORD /d 0 /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\CoreService"" /v DisableCoreServiceECSIntegration /t REG_DWORD /d 0 /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\CoreService"" /v MdDisableResController /t REG_DWORD /d 0 /f & " +@@ -187,18 +195,23 @@ namespace GTweak.Utilities.Tweaks.DefenderManager@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender"" /v DisableAntiSpyware /t REG_DWORD /d 0 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender"" /v DisableAntiVirus /t REG_DWORD /d 0 /f");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\ASR", "EnableASRConsumers");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Controlled Folder Access", "EnableControlledFolderAccess");+ RegistryHelp.DeleteValue(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Windows Defender Exploit Guard\Network Protection", "EnableNetworkProtection");+ImportRights();+ SetTaskState(true, winDefenderTasks);+foreach (var (path, normal, block) in fileMappings){- CommandExecutor.RunCommandAsTrustedInstaller($"{PathLocator.Executable.NSudo} -U:T -P:E -ShowWindowMode:Hide -Wait cmd /c rename \"{Path.Combine(path, block)}\" {normal}");+ CommandExecutor.RunCommandAsTrustedInstaller($"{PathLocator.Executable.NSudo} -U:T -P:E -ShowWindowMode:Hide -Wait cmd /c rename \"{Path.Combine(path, block)}\" \"{normal}\"");}foreach (var service in services){CommandExecutor.RunCommandAsTrustedInstaller($@"{PathLocator.Executable.NSudo} -U:T -P:E -ShowWindowMode:Hide -Wait cmd /c reg add HKLM\SYSTEM\CurrentControlSet\Services\{service.Key} /v Start /t REG_DWORD /d {service.Value} /f");}- SetTaskState(true, winDefenderTasks);InvokePowerShell(@"Get-AppXpackage Microsoft.WindowsDefender | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register ""$($_.InstallLocation)\AppXManifest.xml""}");}@@ -224,9 +237,6 @@ namespace GTweak.Utilities.Tweaks.DefenderManager@"reg add HKLM\SYSTEM\CurrentControlSet\Services\WinDefend /v AutorunsDisabled /t REG_DWORD /d 3 /f & " +@"reg add HKLM\SYSTEM\CurrentControlSet\Services\wscsvc /v DelayedAutoStart /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows Defender\Windows Defender\ControlledFolderAccess"" /v Enable /t REG_DWORD /d 0 /f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\ASR"" /v EnableASRConsumers /t REG_DWORD /d 0 /f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Controlled Folder Access"" /v EnableControlledFolderAccess /t REG_DWORD /d 0 /f & " +- @"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Network Protection"" /v EnableNetworkProtection /t REG_DWORD /d 0 /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\CoreService"" /v DisableCoreService1DSTelemetry /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\CoreService"" /v DisableCoreServiceECSIntegration /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Microsoft\Windows defender\CoreService"" /v MdDisableResController /t REG_DWORD /d 1 /f & " +@@ -236,6 +246,10 @@ namespace GTweak.Utilities.Tweaks.DefenderManager@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender"" /v DisableAntiSpyware /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender"" /v DisableAntiVirus /t REG_DWORD /d 1 /f");+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\ASR", "EnableASRConsumers", 0, RegistryValueKind.DWord, true);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Controlled Folder Access", "EnableControlledFolderAccess", 0, RegistryValueKind.DWord, true);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows defender\Windows defender Exploit Guard\Network Protection", "EnableNetworkProtection", 0, RegistryValueKind.DWord, true);+InvokePowerShell(@"Set-MpPreference -DisableIOAVProtection $trueSet-MpPreference -DisableRealtimeMonitoring $trueSet-MpPreference -DisableBehaviorMonitoring $true@@ -265,6 +279,8 @@ namespace GTweak.Utilities.Tweaks.DefenderManager@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableScriptScanning /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableRawWriteNotification /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableIntrusionPreventionSystem /t REG_DWORD /d 1 /f & " ++ @"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableInformationProtectionControl /t REG_DWORD /d 1 /f & " ++ @"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v RealtimeScanDirection /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisableArchiveScanning /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v SignatureDisableUpdateOnStartupWithoutEngine /t REG_DWORD /d 1 /f & " +@"reg add ""HKLM\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection"" /v DisablePrivacyMode /t REG_DWORD /d 1 /f & " +@@ -283,16 +299,23 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerRegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender", "DisableLocalAdminMerge", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender", "PUAProtection", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile", "DisableNotifications", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PrivateProfile", "DisableNotifications", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile", "DisableNotifications", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications", "DisableEnhancedNotifications", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications", "DisableNotifications", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Features", "DeviceControlEnabled", 0, RegistryValueKind.DWord);+RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "MpEnablePus", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "MpCloudBlockLevel", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "DisableGradualRelease", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "MpBafsExtendedTimeout", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\MpEngine", "EnableFileHashComputation", 0, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "LowCpuPriority", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableReparsePointScanning", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableHeuristics", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableEmailScanning", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableCatchupQuickScan", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableCatchupFullScan", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableScanningNetworkFiles", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableArchiveScanning", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Scan", "DisableRestorePoint", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "ServiceKeepAlive", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware", "AllowFastServiceStartup", 0, RegistryValueKind.DWord);@@ -302,6 +325,22 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerRegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware\SpyNet", "SpyNetReporting", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Microsoft Antimalware\SpyNet", "LocalSettingOverrideSpyNetReporting", 0, RegistryValueKind.DWord);+ CommandExecutor.RunCommandAsTrustedInstaller($"{PathLocator.Executable.NSudo} -U:T -P:E -ShowWindowMode:Hide -Wait cmd /c " ++ @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v DisableBlockAtFirstSeen /t REG_DWORD /d 1 /f & " ++ @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v SpynetReporting /t REG_DWORD /d 0 /f & " ++ @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v SubmitSamplesConsent /t REG_DWORD /d 2 /f & " ++ @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v LocalSettingOverrideSpynetReporting /t REG_DWORD /d 0 /f");++ RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\DomainProfile", "DisableNotifications", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\PrivateProfile", "DisableNotifications", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Services\SharedAccess\Parameters\FirewallPolicy\StandardProfile", "DisableNotifications", 1, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications", "DisableEnhancedNotifications", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Notifications", "DisableNotifications", 1, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "DisallowExploitProtectionOverride", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\App and Browser protection", "UILockdown", 1, RegistryValueKind.DWord);+RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "SignatureDisableNotification", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "RealtimeSignatureDelivery", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "ForceUpdateFromMU", 0, RegistryValueKind.DWord);@@ -312,33 +351,37 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerRegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "DisableScanOnUpdate", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Signature Updates", "ScheduleTime", 5184, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Reporting", "DisableEnhancedNotifications", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Reporting", "DisableGenericRePorts", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Reporting", "WppTracingLevel", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Reporting", "WppTracingComponents", 0, RegistryValueKind.DWord);+RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "FirstRunDisabled", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "AntiVirusOverride", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Security Center", "FirewallOverride", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration", "Notification_Suppress", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration", "SuppressRebootNotification", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\UX Configuration", "Notification_Suppress", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\UX Configuration", "SuppressRebootNotification", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"Software\Policies\Microsoft\Windows Defender\UX Configuration", "UILockdown", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Device performance and health", "UILockdown", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender Security Center\Family optionsObj", "UILockdown", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows Defender\Reportin", "DisableEnhancedNotifications", 1, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Cloud", "DisableBlockAtFirstSeen", 1, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Cloud", "CaptureBetaFeatures", 0, RegistryValueKind.DWord);++ RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\WOW6432Node\Policies\Microsoft\Windows Defender", "DisableRoutinelyTakingAction", 1, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\WMI\Autologger\DefenderApiLogger", "Start", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\WMI\Autologger\DefenderAuditLogger", "Start", 0, RegistryValueKind.DWord);+RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Windows Defender/Operational", "Enabled", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Security-Diagnostic/Operational", "Enabled", 0, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Cloud", "DisableBlockAtFirstSeen", 1, RegistryValueKind.DWord);- RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Microsoft\Windows Defender\Cloud", "CaptureBetaFeatures", 0, RegistryValueKind.DWord);-- CommandExecutor.RunCommandAsTrustedInstaller($"{PathLocator.Executable.NSudo} -U:T -P:E -ShowWindowMode:Hide -Wait cmd /c " +- @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v DisableBlockAtFirstSeen /t REG_DWORD /d 1 /f & " +- @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v SpynetReporting /t REG_DWORD /d 0 /f & " +- @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v SubmitSamplesConsent /t REG_DWORD /d 2 /f & " +- @"reg add ""HKLM\Software\Policies\Microsoft\Windows Defender\SpyNet"" /v LocalSettingOverrideSpynetReporting /t REG_DWORD /d 0 /f");+ RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Policy", "VerifiedAndReputablePolicyState", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "EnabledV9", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\CI\Config", "VulnerableDriverBlocklistEnable", 0, RegistryValueKind.DWord);+ RegistryHelp.Write(Registry.LocalMachine, @"System\CurrentControlSet\Control\CI\State", "HVCIEnabled", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard\Scenarios\HypervisorEnforcedCodeIntegrity", "Enabled", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SYSTEM\CurrentControlSet\Control\DeviceGuard", "EnableVirtualizationBasedSecurity", 0, RegistryValueKind.DWord);RegistryHelp.Write(Registry.LocalMachine, @"SOFTWARE\Policies\Microsoft\Windows\WTDS\Components", "ServiceEnabled", "0", RegistryValueKind.DWord);@@ -426,7 +469,9 @@ namespace GTweak.Utilities.Tweaks.DefenderManagerprivate static void TerminateProcess(){- string[] processes = { "smartscreen", "mpdefendercoreservice", "msmpeng", "securityhealthservice", "securityhealthsystray", "securityhealthui", "wuauserv", "searchui", "sechealthui", "configsecuritypolicy", "runtimebroker", "msedge", "ssoncom", "usocoreworker", "defenderbootstrapper", "configsecuritypolicy", "dlpuseragent", "lsass", "mpam-d", "mpam-fe", "mpam-fe_bd", "mpas-d", "mpas-fe", "mpas-fe_bd", "mpav-d", "mpav-fe", "mpav-fe_bd", "mpcmdrun", "mpcopyaccelerator", "mpdlpcmd", "mpdlpservice", "mpextms", "mpsigstub", "mrt", "msmpengcp", "mssense", "nissrv", "offlinescannershell", "securekernel", "securityhealthhost", "senseap", "senseaptoast", "sensecm", "sensegpparser", "senseidentity", "senseimdscollector", "senseir", "sensendr", "sensesampleuploader", "sensetvm", "sensece", "sgrmbroker", "healthattestationclientagent" };+ string[] processes = { "smartscreen", "mpdefendercoreservice", "msmpeng", "securityhealthservice", "securityhealthsystray", "securityhealthui", "wuauserv", "searchui", "sechealthui", "configsecuritypolicy", "runtimebroker", "msedge", "ssoncom", "usocoreworker", "defenderbootstrapper", "configsecuritypolicy",+ "dlpuseragent", "lsass", "mpam-d", "mpam-fe", "mpam-fe_bd", "mpas-d", "mpas-fe", "mpas-fe_bd", "mpav-d", "mpav-fe", "mpav-fe_bd", "mpcmdrun", "mpcopyaccelerator", "mpdlpcmd", "mpdlpservice", "mpextms", "mpsigstub", "mrt", "msmpengcp", "mssense", "nissrv", "offlinescannershell", "securekernel", "securityhealthhost",+ "senseap", "senseaptoast", "sensecm", "sensegpparser", "senseidentity", "senseimdscollector", "senseir", "sensendr", "sensesampleuploader", "sensetvm", "sensece", "sgrmbroker", "healthattestationclientagent", "wdnissvc", "wdboot", "msseccore", "mssecflt", "mssecwfp", "mdcoresvc", "sensece", "senseui", "sensepp", "wdsheild" };CommandExecutor.RunCommandAsTrustedInstaller($"/c taskkill /f " + string.Join(" ", processes.Select(p => $"/im {p}.exe")));}