:: 1. 恢复Windows更新服务设置
sc config "wuauserv" start= auto >nul
sc config "UsoSvc" start= auto >nul
sc config "BITS" start= auto >nul
sc config "CryptSvc" start= auto >nul
sc config "DcomLaunch" start= auto >nul
sc config "TrustedInstaller" start= auto >nul
net start wuauserv >nul 2>&1
net start UsoSvc >nul 2>&1
net start BITS >nul 2>&1
net start CryptSvc >nul 2>&1
net start TrustedInstaller >nul 2>&1
:: 2. 恢复Windows更新相关注册表设置:: 删除更新暂停设置
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" /v "PauseUpdatesExpiryTime" /f >nul 2>&1
:: 恢复自动更新设置
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /f >nul 2>&1
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v "AUOptions" /t REG_DWORD /d 3 /f >nul