Last active
August 14, 2025 09:18
-
-
Save st1vms/079ae8d2eccd6d471ebee66df6beb1a8 to your computer and use it in GitHub Desktop.
Disable Windows Delivery Optimization service (DoSvc)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Script to create a task that disables and stops the Windows DoSvc service on startup |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set "pwshPath=C:\Program Files\PowerShell\7\pwsh.exe" | |
| set "scriptPath=C:\disable_dosvc.ps1" | |
| schtasks /create ^ | |
| /tn "DisableDoSvc" ^ | |
| /tr "\"%pwshPath%\" -ExecutionPolicy Bypass -File \"%scriptPath%\"" ^ | |
| /sc onstart ^ | |
| /RL highest ^ | |
| /ru SYSTEM | |
| @pause |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disables DoSvc by stopping it on startup and setting Start value to 4 | |
| $regPath = "HKLM:\SYSTEM\CurrentControlSet\Services\DoSvc" | |
| $serviceName = "DoSvc" | |
| if (Get-Service -Name $serviceName -ErrorAction SilentlyContinue) { | |
| Stop-Service -Name $serviceName -Force -ErrorAction Stop | |
| do { | |
| Start-Sleep -Seconds 1 | |
| $status = (Get-Service -Name $serviceName).Status | |
| } while ($status -ne 'Stopped') | |
| } | |
| Set-ItemProperty -Path $regPath -Name "Start" -Value 4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| icacls "C:\disable_dosvc.ps1" /inheritance:r | |
| icacls "C:\disable_dosvc.ps1" /grant:r SYSTEM:F Administrators:R |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment