mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-24 11:55:31 +00:00
Fix policy reset for default updates
This commit is contained in:
parent
640d2ca107
commit
c254a43f77
@ -42,4 +42,24 @@ function Invoke-WPFUpdatesdefault {
|
||||
Write-Host "==================================================="
|
||||
Write-Host "--- Windows Update Settings Reset to Default ---"
|
||||
Write-Host "==================================================="
|
||||
|
||||
Start-Process -FilePath "secedit" -ArgumentList "/configure /cfg $env:windir\inf\defltbase.inf /db defltbase.sdb /verbose" -Wait
|
||||
Start-Process -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicyUsers" -Wait
|
||||
Start-Process -FilePath "cmd.exe" -ArgumentList "/c RD /S /Q $env:WinDir\System32\GroupPolicy" -Wait
|
||||
Start-Process -FilePath "gpupdate" -ArgumentList "/force" -Wait
|
||||
Remove-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKCU:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKCU:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\WindowsSelfHost" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Policies" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\WindowsStore\WindowsUpdate" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
Write-Host "==================================================="
|
||||
Write-Host "--- Windows Local Policies Reset to Default ---"
|
||||
Write-Host "==================================================="
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user