一键彻底关闭WIN10自动更新_BlockWin10AU

因WIN10自动更新,会影响正常的使用甚至工作,小高建议关闭自动更新。

网络中有很多关于WIN10关闭更新的方法,感觉都太麻烦,小高在网络中收集了一枚软件,感觉效果还可以。

 

BlockWin10AU 是一款轻量的开源 Windows 自动更新管理工具。
只需要下载一段 7 KB 的 .bat 批处理文件,右键以管理员身份运行 “Block WAU.bat” 即可禁止Windows10的自动更新功能,由于涉及到系统关键位置,记得先关闭类似360的安全软件。

注:但正因为它如此简单,之后想恢复更新时的步骤也会比较麻烦。

 

 

@echo off
@title BLOCK Win10AU!
@cls
rem mode con cols=70 lines=15
@color 1f
@Setlocal enabledelayedexpansion

@schtasks /query /tn BlockWAU\start_kill 2>nul
@if %ERRORLEVEL%==0 goto task_exist
@echo ※             Creating the tasks for BlockWAU                      ※
@mkdir %ProgramData%\BlockWAU 2>nul
@copy %~dpnx0 %ProgramData%\BlockWAU\BlockWAU.cmd /y>nul

@schtasks /create /ru "SYSTEM" /sc onidle /i 60 /tn BlockWAU\idle_kill /tr "%SystemRoot%\system32\cmd.exe /c '%ProgramData%\BlockWAU\BlockWAU.cmd' tasks" /f /np /rl highest>nul
@schtasks /create /ru "SYSTEM" /sc onstart /delay 0060:00 /tn BlockWAU\start_kill /tr "%SystemRoot%\system32\cmd.exe /c '%ProgramData%\BlockWAU\BlockWAU.cmd' tasks" /f /np /rl highest>nul

:task_exist
@mkdir %ProgramData%\BlockWAU 2>nul
@pushd %ProgramData%\BlockWAU

@set logfile=BlockWAU_%date:~0,-3%_%time:~0,-3%.log
@set logfile=%logfile:/=%
@set logfile=%logfile::=%
@if "%1"=="" @set logfile=con
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>%logfile%
echo ※                 %date%   %time%                    ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                    禁用Windows10自动更新                         ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※          Block Windows X Automatic Update By F1tz                ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                   请先退出360等安全管家!                        ※>>%logfile%
echo ※           请确认右键选择"以管理员身份运行"此脚本                 ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※         Please quit your Anti-Malware software first!             ※>>%logfile%
echo ※  Make sure Right-click on script select "Run as administrator".  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo. >>%logfile%
@if "%1"=="" pause


echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                  结束进程 / Stopping Process...                  ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%

taskkill /im Windows10UpgraderApp.exe 2>>%logfile%
del /f /q "%USERPROFILE%\Desktop\微软 Windows 10 易升.lnk" 2>>%logfile%
del /f /q "%USERPROFILE%\Desktop\Windows 10 Update Assistant.lnk" 2>>%logfile%

echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※           添加防火墙规则 / Adding firewall rules...              ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%

netsh advfirewall firewall add rule name="Block_Windows10UpgraderApp" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\Windows10UpgraderApp.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_WinREBootApp32" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\WinREBootApp32.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_WinREBootApp64" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\WinREBootApp64.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_bootsect" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\bootsect.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_DW20" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\DW20.EXE" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_DWTRIG20" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\DWTRIG20.EXE" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_GatherOSState" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\GatherOSState.EXE" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_GetCurrentRollback" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\GetCurrentRollback.EXE" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_HttpHelper" dir=in program="%SYSTEMDRIVE%\Windows10Upgrade\HttpHelper.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_UpdateAssistant" dir=in program="%SYSTEMROOT%\UpdateAssistant\UpdateAssistant.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_UpdateAssistantCheck" dir=in program="%SYSTEMROOT%\UpdateAssistant\UpdateAssistantCheck.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_Windows10Upgrade" dir=in program="%SYSTEMROOT%\UpdateAssistant\Windows10Upgrade.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_UpdateAssistantV2" dir=in program="%SYSTEMROOT%\UpdateAssistantV2\UpdateAssistant.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_UpdateAssistantCheckV2" dir=in program="%SYSTEMROOT%\UpdateAssistantV2\UpdateAssistantCheck.exe" action=block>>%logfile%
netsh advfirewall firewall add rule name="Block_Windows10UpgradeV2" dir=in program="%SYSTEMROOT%\UpdateAssistantV2\Windows10Upgrade.exe" action=block>>%logfile%

echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                 设置ACL / Configurating ACL...                   ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%


echo y|cacls %SystemRoot%\UpdateAssistant\*.exe /t /p everyone:n>>%logfile%
echo y|cacls %SystemRoot%\UpdateAssistantV2\*.exe /t /p everyone:n>>%logfile%
echo y|cacls %SystemDrive%\Windows10Upgrade\*.exe /t /p everyone:n>>%logfile%
@rem takeown /F %SystemRoot%\system32\wuauclt.exe /A /R /D Y
@rem echo y|cacls %SystemRoot%\system32\wuauclt.exe /t /p everyone:n
@rem icacls %SystemRoot%\system32\wuauclt.exe /grant Administrators:F /T
@rem %SystemRoot%\system32\wuauclt.exe
@rem %SystemRoot%\system32\wuaueng.dll


@rem ren %SystemDrive%\windows10Upgrade windows10Upgrade_disable
@rem ren %SystemRoot%\UpdateAssistant UpdateAssistant_disable
@rem ren %SystemRoot%\UpdateAssistantV2 UpdateAssistantV2_disable
echo. >>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※         停止Windows Update服务 / Disable Windows Update          ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%

net stop wuauserv 2>>%logfile%
net stop osrss 2>>%logfile%
net stop BITS 2>>%logfile%
net stop WaaSMedicSVC 2>>%logfile%
net stop UsoSvc 2>>%logfile%

sc config wuauserv start= disabled>>%logfile%
sc config osrss start= disabled>>%logfile%
sc config BITS start= disabled>>%logfile%
sc config WaaSMedicSVC start= disabled>>%logfile%
sc config UsoSvc start= disabled>>%logfile%

sc failure wuauserv reset= 0 actions= "">>%logfile%
sc failure osrss reset= 0 actions= "">>%logfile%
sc failure BITS reset= 0 actions= "">>%logfile%
sc failure WaaSMedicSVC reset= 0 actions= "">>%logfile%
sc failure UsoSvc reset= 0 actions= "">>%logfile%

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\wuauserv" /v "Start" /d 4 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\osrss" /v "Start" /d 4 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BITS" /v "Start" /d 4 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WaaSMedicSvc" /v "Start" /d 4 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\UsoSvc" /v "Start" /d 4 /t REG_DWORD /f>>%logfile%


echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                   禁用计划任务 / Disable task...                  ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%

@rem schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistant" /f 2>>%logfile%
@rem schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantAllUsersRun" /f 2>>%logfile%
@rem schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantCalendarRun" /f 2>>%logfile%
@rem schtasks /delete /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantWakeupRun" /f 2>>%logfile%

@rem takeown /F C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /A /R
@rem takeown /F C:\Windows\System32\Tasks\Microsoft\Windows\UpdateAssistant /A /R
@rem takeown /F C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /A /R
@rem icacls C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /grant Administrators:F /T
@rem icacls C:\Windows\System32\Tasks\Microsoft\Windows\UpdateAssistant /grant Administrators:F /T
@rem icacls C:\Windows\System32\Tasks\Microsoft\Windows\UpdateOrchestrator /grant Administrators:F /T

@rem Combined Scan Download Install
@rem Maintenance Install
@rem Policy Install
@rem Reboot
@rem Refresh Settings
@rem Resume On Boot
@rem Schedule Scan
@rem USO_UxBroker_Display
@rem USO_UxBroker_ReadyToReboot  
@rem 本条及以上任务无法或不能删除,删除后进不去系统,设为禁用即可

schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistant"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantAllUsersRun"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantCalendarRun"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantWakeupRun"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\Maintenance Install"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\Reboot"  /disable>>%logfile%
@rem 以下两个任务不能删除,否则系统无法启动>>%logfile%
@rem schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan"  /disable>>%logfile%
@rem schtasks /change /TN "\Microsoft\Windows\UpdateOrchestrator\USO_Broker_Display"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateAssistant\UpdateAssistant"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\UpdateAssistant\UpdateAssistantCalendarRun"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\WindowsUpdate\Scheduled Start"  /disable>>%logfile%
schtasks /change /TN "\Microsoft\Windows\WindowsUpdate\sih"  /disable>>%logfile%

echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                 设置注册表 / Editing Registry...                 ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "DisableOSUpgrade" /d 1 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade" /v "ReservationsAllowed" /d 0 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate" /v "DoNotConnectToWindowsUpdateInternetLocations" /d 1 /t REG_DWORD /f>>%logfile%
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v "NoAutoUpdate" /d 1 /t REG_DWORD /f>>%logfile%

rem del /q /f %SYSTEMDRIVE%\NAU.reg 2>>%logfile%
rem echo Windows Registry Editor Version 5.00 >> %SYSTEMDRIVE%\NAU.reg
rem echo.>> %SYSTEMDRIVE%\NAU.reg
rem echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate]>> %SYSTEMDRIVE%\NAU.reg
rem echo "DoNotConnectToWindowsUpdateInternetLocations"=dword:00000001 >> %SYSTEMDRIVE%\NAU.reg
rem echo.>> %SYSTEMDRIVE%\NAU.reg
rem echo [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU]>> %SYSTEMDRIVE%\NAU.reg
rem echo "NoAutoUpdate"=dword:00000001>> %SYSTEMDRIVE%\NAU.reg
rem REG IMPORT %SYSTEMDRIVE%\NAU.reg
rem del /q /f %SYSTEMDRIVE%\NAU.reg 2>>%logfile%

echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※                       任务结束 / All Done!                      ※>>%logfile%
echo ※                                                                  ※>>%logfile%
echo ※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※※>>%logfile%
@if "%1"=="" pause
@popd
@exit

 

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页