Disable "Windows Security Service" service
- 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 the Windows Security Service, a component that manages various Windows security features.
This service is known as Windows Security Service 1, SecurityHealthService
2
or Windows Security Health Service 2 3.
It provides device protection and system health information 1 3.
This service is part of the Windows Security interface 2 4. Windows Security is a centralized interface managing various Windows security features 5. In earlier Windows versions, this interface was called Security Center 5.
This service is also a component of Defender for Endpoint and Defender Antivirus 4. However, disabling this service does not affect the functionality of Defender Antivirus 2.
Disabling this service may enhance privacy by limiting data collection related to system security. It may also improve system performance by preventing the service from running in the background. However, it may decrease security by disabling the Windows Security interface and restricting access to security information.
Disabling this service may prevent you from accessing Windows Security features and receiving important security notifications.
Technical Details
The Windows Security interface relies on this service 2.
By default, Windows is set to start this service manually 1. Although tests indicate it runs automatically on Windows 10 and 11.
The service is located at %SYSTEMROOT%\System32\SecurityHealthService.exe
1 3 6
Overview of default service statuses
OS Version | Status | Start type |
---|---|---|
Windows 10 (≥ 22H2) | 🟢 Running | Manual |
Windows 11 (≥ 23H2) | 🔴 Stopped | Manual |
- 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
- Windows Security Service - Windows 10 Service - batcmd.com. (2023).
Original: http://batcmd.com/windows/10/services/securityhealthservice
Archived: https://web.archive.org/web/20231013160338/http://batcmd.com/windows/10/services/securityhealthservice/ - Windows Security - Windows Security. Microsoft Learn. (2023).
Original: https://learn.microsoft.com/en-us/windows/security/operating-system-security/system-security/windows-defender-security-center/windows-defender-security-center
Archived: https://web.archive.org/web/20231013153902/https://learn.microsoft.com/en-us/windows/security/operating-system-security/system-security/windows-defender-security-center/windows-defender-security-center - SecurityHealthService.exe. Windows Security Health Service. STRONTIC. strontic.github.io. (2023).
Original: https://strontic.github.io/xcyclopedia/library/SecurityHealthService.exe-96BE970B2CB0BB0A86D8F74C1A3F8596.html
Archived: https://web.archive.org/web/20231013160352/https://strontic.github.io/xcyclopedia/library/SecurityHealthService.exe-96BE970B2CB0BB0A86D8F74C1A3F8596.html - 4. (2023).
Original: https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-antivirus-compatibility
Archived: https://web.archive.org/web/20231013160458/https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/microsoft-defender-antivirus-compatibility?view=o365-worldwide#notes-about-protection-states - Stay protected with Windows Security - Microsoft Support. support.microsoft.com. (2023).
Original: https://support.microsoft.com/en-us/windows/stay-protected-with-windows-security-2ae0363d-0ada-c064-8b56-6a39afb6a963
Archived: https://web.archive.org/web/20231103171802/https://support.microsoft.com/en-us/windows/stay-protected-with-windows-security-2ae0363d-0ada-c064-8b56-6a39afb6a963 - nickel-x64/WinSxS/Manifests/amd64_windows-shield-provider_31bf3856ad364e35_10.0.22621.1_none_078b8e81c1191957.manifest at b3f8c9549e49f2a92b401b3809b210d5f78190ba · privacysexy-forks/nickel-x64. github.com. (2024).
Original: https://github.com/privacysexy-forks/nickel-x64/blob/b3f8c9549e49f2a92b401b3809b210d5f78190ba/WinSxS/Manifests/amd64_windows-shield-provider_31bf3856ad364e35_10.0.22621.1_none_078b8e81c1191957.manifest
Archived: https://web.archive.org/web/20240912123628/https://github.com/privacysexy-forks/nickel-x64/blob/b3f8c9549e49f2a92b401b3809b210d5f78190ba/WinSxS/Manifests/amd64_windows-shield-provider_31bf3856ad364e35_10.0.22621.1_none_078b8e81c1191957.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 "Windows Security Service" service" 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 "Windows Security Service" service" using privacy.sexy
- ≈ 3 min to complete
- Tools: privacy.sexy
- Difficulty: Simple
- ≈ 4 instructions
- 2
Choose script
- Search for the script name: Disable "Windows Security Service" service
- 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
:: Disable the service `SecurityHealthService` using TrustedInstaller privileges
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 = '$serviceQuery = ''SecurityHealthService'''+"^""`r`n"^""+'$stopWithDependencies= $false'+"^""`r`n"^""+'<# -- 1. Skip if service does not exist #>'+"^""`r`n"^""+'$service = Get-Service -Name $serviceQuery -ErrorAction SilentlyContinue'+"^""`r`n"^""+'if(!$service) {'+"^""`r`n"^""+' Write-Host "^""Service query `"^""$serviceQuery`"^"" did not yield any results, no need to disable it."^""'+"^""`r`n"^""+' Exit 0'+"^""`r`n"^""+'}'+"^""`r`n"^""+'$serviceName = $service.Name'+"^""`r`n"^""+'Write-Host "^""Disabling service: `"^""$serviceName`"^""."^""'+"^""`r`n"^""+'<# -- 2. Stop if running #>'+"^""`r`n"^""+'if ($service.Status -eq [System.ServiceProcess.ServiceControllerStatus]::Running) {'+"^""`r`n"^""+' Write-Host "^""`"^""$serviceName`"^"" is running, attempting to stop it."^""'+"^""`r`n"^""+' try {'+"^""`r`n"^""+' Write-Host "^""Stopping the service `"^""$serviceName`"^""."^""'+"^""`r`n"^""+' $stopParams = @{ `'+"^""`r`n"^""+' Name = $ServiceName'+"^""`r`n"^""+' Force = $true'+"^""`r`n"^""+' ErrorAction = ''Stop'''+"^""`r`n"^""+' }'+"^""`r`n"^""+' if (-not $stopWithDependencies) {'+"^""`r`n"^""+' $stopParams[''NoWait''] = $true'+"^""`r`n"^""+' }'+"^""`r`n"^""+' Stop-Service @stopParams'+"^""`r`n"^""+' Write-Host "^""Stopped `"^""$serviceName`"^"" successfully."^""'+"^""`r`n"^""+' } catch {'+"^""`r`n"^""+' if ($_.FullyQualifiedErrorId -eq ''CouldNotStopService,Microsoft.PowerShell.Commands.StopServiceCommand'') {'+"^""`r`n"^""+' Write-Warning "^""The service `"^""$serviceName`"^"" does not accept a stop command and may need to be stopped manually or on reboot."^""'+"^""`r`n"^""+' } else {'+"^""`r`n"^""+' Write-Warning "^""Failed to stop service `"^""$ServiceName`"^"". It will be stopped after reboot. Error: $($_.Exception.Message)"^""'+"^""`r`n"^""+' }'+"^""`r`n"^""+' }'+"^""`r`n"^""+'} else {'+"^""`r`n"^""+' Write-Host "^""`"^""$serviceName`"^"" is not running, no need to stop."^""'+"^""`r`n"^""+'}'+"^""`r`n"^""+'<# -- 3. Skip if service info is not found in registry #>'+"^""`r`n"^""+'$registryKey = "^""HKLM:\SYSTEM\CurrentControlSet\Services\$serviceName"^""'+"^""`r`n"^""+'if (-Not (Test-Path $registryKey)) {'+"^""`r`n"^""+' Write-Host "^""`"^""$registryKey`"^"" is not found in registry, cannot enable it."^""'+"^""`r`n"^""+' Exit 0'+"^""`r`n"^""+'}'+"^""`r`n"^""+'<# -- 4. Skip if already disabled #>'+"^""`r`n"^""+'if( $(Get-ItemProperty -Path "^""$registryKey"^"").Start -eq 4) {'+"^""`r`n"^""+' Write-Host "^""`"^""$serviceName`"^"" is already disabled from start, no further action is needed."^""'+"^""`r`n"^""+' Exit 0'+"^""`r`n"^""+'}'+"^""`r`n"^""+'<# -- 5. Disable service #>'+"^""`r`n"^""+'try {'+"^""`r`n"^""+' Set-ItemProperty `'+"^""`r`n"^""+' -LiteralPath $registryKey `'+"^""`r`n"^""+' -Name "^""Start"^"" `'+"^""`r`n"^""+' -Value 4 `'+"^""`r`n"^""+' -ErrorAction Stop'+"^""`r`n"^""+' Write-Host ''Successfully disabled the service. It will not start automatically on next boot.'''+"^""`r`n"^""+'} catch {'+"^""`r`n"^""+' Write-Error "^""Failed to disable the service. Error: $($_.Exception.Message)"^""'+"^""`r`n"^""+' Exit 1'+"^""`r`n"^""+'}'; Invoke-AsTrustedInstaller $cmd"
:: Soft delete files matching pattern: "%SYSTEMROOT%\System32\SecurityHealthService.exe" with additional permissions
PowerShell -ExecutionPolicy Unrestricted -Command "$pathGlobPattern = "^""%SYSTEMROOT%\System32\SecurityHealthService.exe"^""; $expandedPath = [System.Environment]::ExpandEnvironmentVariables($pathGlobPattern); Write-Host "^""Searching for items matching pattern: `"^""$($expandedPath)`"^""."^""; $renamedCount = 0; $skippedCount = 0; $failedCount = 0; Add-Type -TypeDefinition "^""using System;`r`nusing System.Runtime.InteropServices;`r`npublic class Privileges {`r`n [DllImport(`"^""advapi32.dll`"^"", ExactSpelling = true, SetLastError = true)]`r`n internal static extern bool AdjustTokenPrivileges(IntPtr htok, bool disall,`r`n ref TokPriv1Luid newst, int len, IntPtr prev, IntPtr relen);`r`n [DllImport(`"^""advapi32.dll`"^"", ExactSpelling = true, SetLastError = true)]`r`n internal static extern bool OpenProcessToken(IntPtr h, int acc, ref IntPtr phtok);`r`n [DllImport(`"^""advapi32.dll`"^"", SetLastError = true)]`r`n internal static extern bool LookupPrivilegeValue(string host, string name, ref long pluid);`r`n [StructLayout(LayoutKind.Sequential, Pack = 1)]`r`n internal struct TokPriv1Luid {`r`n public int Count;`r`n public long Luid;`r`n public int Attr;`r`n }`r`n internal const int SE_PRIVILEGE_ENABLED = 0x00000002;`r`n internal const int TOKEN_QUERY = 0x00000008;`r`n internal const int TOKEN_ADJUST_PRIVILEGES = 0x00000020;`r`n public static bool AddPrivilege(string privilege) {`r`n try {`r`n bool retVal;`r`n TokPriv1Luid tp;`r`n IntPtr hproc = GetCurrentProcess();`r`n IntPtr htok = IntPtr.Zero;`r`n retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);`r`n tp.Count = 1;`r`n tp.Luid = 0;`r`n tp.Attr = SE_PRIVILEGE_ENABLED;`r`n retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);`r`n retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);`r`n return retVal;`r`n } catch (Exception ex) {`r`n throw new Exception(`"^""Failed to adjust token privileges`"^"", ex);`r`n }`r`n }`r`n public static bool RemovePrivilege(string privilege) {`r`n try {`r`n bool retVal;`r`n TokPriv1Luid tp;`r`n IntPtr hproc = GetCurrentProcess();`r`n IntPtr htok = IntPtr.Zero;`r`n retVal = OpenProcessToken(hproc, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, ref htok);`r`n tp.Count = 1;`r`n tp.Luid = 0;`r`n tp.Attr = 0; // This line is changed to revoke the privilege`r`n retVal = LookupPrivilegeValue(null, privilege, ref tp.Luid);`r`n retVal = AdjustTokenPrivileges(htok, false, ref tp, 0, IntPtr.Zero, IntPtr.Zero);`r`n return retVal;`r`n } catch (Exception ex) {`r`n throw new Exception(`"^""Failed to adjust token privileges`"^"", ex);`r`n }`r`n }`r`n [DllImport(`"^""kernel32.dll`"^"", CharSet = CharSet.Auto)]`r`n public static extern IntPtr GetCurrentProcess();`r`n}"^""; [Privileges]::AddPrivilege('SeRestorePrivilege') | Out-Null; [Privileges]::AddPrivilege('SeTakeOwnershipPrivilege') | Out-Null; $adminSid = New-Object System.Security.Principal.SecurityIdentifier 'S-1-5-32-544'; $adminAccount = $adminSid.Translate([System.Security.Principal.NTAccount]); $adminFullControlAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule( $adminAccount, [System.Security.AccessControl.FileSystemRights]::FullControl, [System.Security.AccessControl.AccessControlType]::Allow ); $foundAbsolutePaths = @(); try { $foundAbsolutePaths += @(; Get-Item -Path $expandedPath -ErrorAction Stop | Select-Object -ExpandProperty FullName; ); } catch [System.Management.Automation.ItemNotFoundException] { <# Swallow, do not run `Test-Path` before, it's unreliable for globs requiring extra permissions #>; }; $foundAbsolutePaths = $foundAbsolutePaths | Select-Object -Unique | Sort-Object -Property { $_.Length } -Descending; if (!$foundAbsolutePaths) { Write-Host 'Skipping, no items available.'; exit 0; }; Write-Host "^""Initiating processing of $($foundAbsolutePaths.Count) items from `"^""$expandedPath`"^""."^""; foreach ($path in $foundAbsolutePaths) { if (Test-Path -Path $path -PathType Container) { Write-Host "^""Skipping folder (not its contents): `"^""$path`"^""."^""; $skippedCount++; continue; }; if($revert -eq $true) { if (-not $path.EndsWith('.OLD')) { Write-Host "^""Skipping non-backup file: `"^""$path`"^""."^""; $skippedCount++; continue; }; } else { if ($path.EndsWith('.OLD')) { Write-Host "^""Skipping backup file: `"^""$path`"^""."^""; $skippedCount++; continue; }; }; $originalFilePath = $path; Write-Host "^""Processing file: `"^""$originalFilePath`"^""."^""; if (-Not (Test-Path $originalFilePath)) { Write-Host "^""Skipping, file `"^""$originalFilePath`"^"" not found."^""; $skippedCount++; exit 0; }; $originalAcl = Get-Acl -Path "^""$originalFilePath"^""; $accessGranted = $false; try { $acl = Get-Acl -Path "^""$originalFilePath"^""; $acl.SetOwner($adminAccount) <# Take Ownership (because file is owned by TrustedInstaller) #>; $acl.AddAccessRule($adminFullControlAccessRule) <# Grant rights to be able to move the file #>; Set-Acl -Path $originalFilePath -AclObject $acl -ErrorAction Stop; $accessGranted = $true; } catch { Write-Warning "^""Failed to grant access to `"^""$originalFilePath`"^"": $($_.Exception.Message)"^""; }; if ($revert -eq $true) { $newFilePath = $originalFilePath.Substring(0, $originalFilePath.Length - 4); } else { $newFilePath = "^""$($originalFilePath).OLD"^""; }; try { Move-Item -LiteralPath "^""$($originalFilePath)"^"" -Destination "^""$newFilePath"^"" -Force -ErrorAction Stop; Write-Host "^""Successfully processed `"^""$originalFilePath`"^""."^""; $renamedCount++; if ($accessGranted) { try { Set-Acl -Path $newFilePath -AclObject $originalAcl -ErrorAction Stop; } catch { Write-Warning "^""Failed to restore access on `"^""$newFilePath`"^"": $($_.Exception.Message)"^""; }; }; } catch { Write-Error "^""Failed to rename `"^""$originalFilePath`"^"" to `"^""$newFilePath`"^"": $($_.Exception.Message)"^""; $failedCount++; if ($accessGranted) { try { Set-Acl -Path $originalFilePath -AclObject $originalAcl -ErrorAction Stop; } catch { Write-Warning "^""Failed to restore access on `"^""$originalFilePath`"^"": $($_.Exception.Message)"^""; }; }; }; }; if (($renamedCount -gt 0) -or ($skippedCount -gt 0)) { Write-Host "^""Successfully processed $renamedCount items and skipped $skippedCount items."^""; }; if ($failedCount -gt 0) { Write-Warning "^""Failed to process $($failedCount) items."^""; }; [Privileges]::RemovePrivilege('SeRestorePrivilege') | Out-Null; [Privileges]::RemovePrivilege('SeTakeOwnershipPrivilege') | Out-Null"
:: Check and terminate the running process "SecurityHealthService.exe"
tasklist /fi "ImageName eq SecurityHealthService.exe" /fo csv 2>NUL | find /i "SecurityHealthService.exe">NUL && (
echo SecurityHealthService.exe is running and will be killed.
taskkill /f /im SecurityHealthService.exe
) || (
echo Skipping, SecurityHealthService.exe is not running.
)
:: Configure termination of "SecurityHealthService.exe" immediately upon its startup
:: Set the registry value: "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SecurityHealthService.exe!Debugger"
PowerShell -ExecutionPolicy Unrestricted -Command "$registryPath = 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SecurityHealthService.exe'; $data = '%SYSTEMROOT%\System32\taskkill.exe'; reg add 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\SecurityHealthService.exe' /v 'Debugger' /t 'REG_SZ' /d "^""$data"^"" /f"
:: Add a rule to prevent the executable "SecurityHealthService.exe" from running via File Explorer
PowerShell -ExecutionPolicy Unrestricted -Command "$executableFilename='SecurityHealthService.exe'; try { $registryPathForDisallowRun='HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun'; $existingBlockEntries = Get-ItemProperty -Path "^""$registryPathForDisallowRun"^"" -ErrorAction Ignore; $nextFreeRuleIndex = 1; if ($existingBlockEntries) { $existingBlockingRuleForExecutable = $existingBlockEntries.PSObject.Properties | Where-Object { $_.Value -eq $executableFilename }; if ($existingBlockingRuleForExecutable) { $existingBlockingRuleIndexForExecutable = $existingBlockingRuleForExecutable.Name; Write-Output "^""Skipping, no action needed: '$executableFilename' is already blocked under rule index `"^""$existingBlockingRuleIndexForExecutable`"^""."^""; exit 0; }; $occupiedRuleIndexes = $existingBlockEntries.PSObject.Properties | Where-Object { $_.Name -Match '^\d+$' } | Select -ExpandProperty Name; if ($occupiedRuleIndexes) { while ($occupiedRuleIndexes -Contains $nextFreeRuleIndex) { $nextFreeRuleIndex += 1; }; }; }; Write-Output "^""Adding block rule for `"^""$executableFilename`"^"" under rule index `"^""$nextFreeRuleIndex`"^""."^""; if (!(Test-Path $registryPathForDisallowRun)) { New-Item -Path "^""$registryPathForDisallowRun"^"" -Force -ErrorAction Stop | Out-Null; }; New-ItemProperty -Path "^""$registryPathForDisallowRun"^"" -Name "^""$nextFreeRuleIndex"^"" -PropertyType String -Value "^""$executableFilename"^"" ` -ErrorAction Stop | Out-Null; Write-Output "^""Successfully blocked `"^""$executableFilename`"^"" with rule index `"^""$nextFreeRuleIndex`"^""."^""; } catch { Write-Error "^""Failed to block `"^""$executableFilename`"^"": $_"^""; Exit 1; }"
:: Activate the DisallowRun policy to block specified programs from running via File Explorer
PowerShell -ExecutionPolicy Unrestricted -Command "try { $fileExplorerDisallowRunRegistryPath = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'; $currentDisallowRunPolicyValue = Get-ItemProperty -Path "^""$fileExplorerDisallowRunRegistryPath"^"" -Name 'DisallowRun' -ErrorAction Ignore | Select -ExpandProperty DisallowRun; if ([string]::IsNullOrEmpty($currentDisallowRunPolicyValue)) { Write-Output "^""Creating DisallowRun policy at `"^""$fileExplorerDisallowRunRegistryPath`"^""."^""; if (!(Test-Path $fileExplorerDisallowRunRegistryPath)) { New-Item -Path "^""$fileExplorerDisallowRunRegistryPath"^"" -Force -ErrorAction Stop | Out-Null; }; New-ItemProperty -Path "^""$fileExplorerDisallowRunRegistryPath"^"" -Name 'DisallowRun' -Value 1 -PropertyType DWORD -Force -ErrorAction Stop | Out-Null; Write-Output 'Successfully activated DisallowRun policy.'; Exit 0; }; if ($currentDisallowRunPolicyValue -eq 1) { Write-Output 'Skipping, no action needed: DisallowRun policy is already in place.'; Exit 0; }; Write-Output 'Updating DisallowRun policy from unexpected value `"^""$currentDisallowRunPolicyValue`"^"" to `"^""1`"^"".'; Set-ItemProperty -Path "^""$fileExplorerDisallowRunRegistryPath"^"" -Name 'DisallowRun' -Value 1 -Type DWORD -Force -ErrorAction Stop | Out-Null; Write-Output 'Successfully activated DisallowRun policy.'; } catch { Write-Error "^""Failed to activate DisallowRun policy: $_"^""; Exit 1; }"
Ijo6IFJlc3RvcmUgdGhlIHNlcnZpY2UgYFNlY3VyaXR5SGVhbHRoU2VydmljZWAgdXNpbmcgVHJ1c3RlZEluc3RhbGxlciBwcml2aWxlZ2VzXG5Qb3dlclNoZWxsIC1FeGVjdXRpb25Qb2xpY3kgVW5yZXN0cmljdGVkIC1Db21tYW5kIFwiZnVuY3Rpb24gSW52b2tlLUFzVHJ1c3RlZEluc3RhbGxlcigkU2NyaXB0KSB7ICRwcmluY2lwYWxTaWQgPSBbU3lzdGVtLlNlY3VyaXR5LlByaW5jaXBhbC5TZWN1cml0eUlkZW50aWZpZXJdOjpuZXcoJ1MtMS01LTgwLTk1NjAwODg4NS0zNDE4NTIyNjQ5LTE4MzEwMzgwNDQtMTg1MzI5MjYzMS0yMjcxNDc4NDY0Jyk7ICRwcmluY2lwYWxOYW1lID0gJHByaW5jaXBhbFNpZC5UcmFuc2xhdGUoW1N5c3RlbS5TZWN1cml0eS5QcmluY2lwYWwuTlRBY2NvdW50XSk7ICRzdHJlYW1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YHJgbiAgICAgICAgICAgIHRwLkx1aWQgPSAwO2ByYG4gICAgICAgICAgICB0cC5BdHRyID0gU0VfUFJJVklMRUdFX0VOQUJMRUQ7YHJgbiAgICAgICAgICAgIHJldFZhbCA9IExvb2t1cFByaXZpbGVnZVZhbHVlKG51bGwsIHByaXZpbGVnZSwgcmVmIHRwLkx1aWQpO2ByYG4gICAgICAgICAgICByZXRWYWwgPSBBZGp1c3RUb2tlblByaXZpbGVnZXMoaHRvaywgZmFsc2UsIHJlZiB0cCwgMCwgSW50UHRyLlplcm8sIEludFB0ci5aZXJvKTtgcmBuICAgICAgICAgICAgcmV0dXJuIHJldFZhbDtgcmBuICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZXgpIHtgcmBuICAgICAgICAgICAgdGhyb3cgbmV3IEV4Y2VwdGlvbihgXCJeXCJcIkZhaWxlZCB0byBhZGp1c3QgdG9rZW4gcHJpdmlsZWdlc2BcIl5cIlwiLCBleCk7YHJgbiAgICAgICAgfWByYG4gICAgfWByYG4gICAgcHVibGljIHN0YXRpYyBib29sIFJlbW92ZVByaXZpbGVnZShzdHJpbmcgcHJpdmlsZWdlKSB7YHJgbiAgICAgICAgdHJ5IHtgcmBuICAgICAgICAgICAgYm9vbCByZXRWYWw7YHJgbiAgICAgICAgICAgIFRva1ByaXYxTHVpZCB0cDtgcmBuICAgICAgICAgICAgSW50UHRyIGhwcm9jID0gR2V0Q3VycmVudFByb2Nlc3MoKTtgcmBuICAgICAgICAgICAgSW50UHRyIGh0b2sgPSBJbnRQdHIuWmVybztgcmBuICAgICAgICAgICAgcmV0VmFsID0gT3BlblByb2Nlc3NUb2tlbihocHJvYywgVE9LRU5fQURKVVNUX1BSSVZJTEVHRVMgfCBUT0tFTl9RVUVSWSwgcmVmIGh0b2spO2ByYG4gICAgICAgICAgICB0cC5Db3VudCA9IDE7YHJgbiAgICAgICAgICAgIHRwLkx1aWQgPSAwO2ByYG4gICAgICAgICAgICB0cC5BdHRyID0gMDsgIC8v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dW5Qb2xpY3lWYWx1ZWBcIl5cIlwiLlwiXlwiXCI7IEV4aXQgMDsgfTsgJHJlbWFpbmluZ0Jsb2NraW5nUnVsZXMgPSBHZXQtSXRlbVByb3BlcnR5IC1QYXRoICdIS0NVOlxcU29mdHdhcmVcXE1pY3Jvc29mdFxcV2luZG93c1xcQ3VycmVudFZlcnNpb25cXFBvbGljaWVzXFxFeHBsb3JlclxcRGlzYWxsb3dSdW4nIC1FcnJvckFjdGlvbiBJZ25vcmU7IGlmICgkcmVtYWluaW5nQmxvY2tpbmdSdWxlcykgeyBXcml0ZS1PdXRwdXQgJ1NraXBwaW5nIGRlYWN0aXZhdGluZyBEaXNhbGxvd1J1biBwb2xpY3ksIHRoZXJlIGFyZSBzdGlsbCBhY3RpdmUgcnVsZXMuJzsgRXhpdCAwOyB9OyBXcml0ZS1PdXRwdXQgJ05vIHJlbWFpbmluZyBydWxlcywgZGVsZXRpbmcgRGlzYWxsb3dSdW4gcG9saWN5Lic7IFJlbW92ZS1JdGVtUHJvcGVydHkgLVBhdGggJ0hLQ1U6XFxTb2Z0d2FyZVxcTWljcm9zb2Z0XFxXaW5kb3dzXFxDdXJyZW50VmVyc2lvblxcUG9saWNpZXNcXEV4cGxvcmVyJyAtTmFtZSAnRGlzYWxsb3dSdW4nIC1Gb3JjZSAtRXJyb3JBY3Rpb24gU3RvcDsgV3JpdGUtT3V0cHV0ICdTdWNjZXNzZnVsbHkgcmVzdG9yZWQgRGlzYWxsb3dSdW4gcG9saWN5Lic7IH0gY2F0Y2ggeyBXcml0ZS1FcnJvciBcIl5cIlwiRmFpbGVkIHRvIHJlc3RvcmUgRGlzYWxsb3dSdW4gcG9saWN5OiAkX1wiXlwiXCI7IEV4aXQgMTsgfVwiIg==
Help
How to apply or restore "Disable "Windows Security Service" service" 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 interface background services
- Disable Windows Security interface
- Disable Defender
- Privacy over security
This category provides scripts to disable background services supporting Defender interface elements. These services enable real-time updates and interac...
This category offers scripts to disable or modify different aspects of the Windows Security user interface, formerly known as Windows Defender Security C...
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 interface background services 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.