关闭Windows更新

关闭Windows更新功能的方法有以下几种:

1 通过设置中的Windows更新选项关闭:打开“设置”应用,选择“更新和安全”,在左侧导航栏中选择“Windows更新”,在“更新设置”下点击“更改活动小时”,将开关从“开”调整为“关”。

2 通过服务管理关闭Windows更新:按下Win + R组合键,打开运行对话框,输入“services.msc”,打开“服务”窗口,在列表中找到“Windows更新”服务,右键单击该服务,在弹出的菜单中选择“属性”,在“常规”选项卡中选择“停止”,并将“启动类型”设置为“禁用”。

3 使用组策略编辑器关闭Windows更新:按下Win + R组合键,打开运行对话框,输入“gpedit.msc”,打开“组策略编辑器”,依次展开“计算机配置”、“管理模板”、“Windows组件”、“Windows更新”,在右侧窗口中找到“配置自动更新”,双击打开,选择“已禁用”,点击“确定”。

复制代码
@echo off
echo 禁用Windows更新...

:: 停止并禁用Windows更新相关服务
sc stop wuauserv
sc config wuauserv start= disabled

sc stop WaaSMedicSvc
sc config WaaSMedicSvc start= disabled

sc stop UsoSvc
sc config UsoSvc start= disabled

sc stop bits
sc config bits start= disabled

sc stop dosvc
sc config dosvc start= disabled

sc stop wuauserv
sc stop WaaSMedicSvc
sc stop UsoSvc
sc stop bits
sc stop dosvc

:: 设置组策略以禁用自动更新
reg add "HKLM\Software\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoUpdate /t REG_DWORD /d 1 /f

:: 禁用Windows Update Assistant
takeown /f "%windir%\System32\UpdateAssistant" /a /r /d y
icacls "%windir%\System32\UpdateAssistant" /inheritance:r /deny "Administrators":F

:: 禁用Windows更新计划任务
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\Schedule Scan" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_ReadyToReboot" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\Reboot" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\USO_UxBroker_Display" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\USO_Broker_Display" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantCalendarRun" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistantWakeupRun" /Disable
schtasks /Change /TN "\Microsoft\Windows\UpdateOrchestrator\UpdateAssistant" /Disable

echo Windows 10 自动更新已被禁用。
pause
复制代码

最后还是直接脚本。。但是发现这些都是只能禁用自动更新,阻止不了主动更新。为此使用了下面方法

  1. gpedit.msc  计算机配置-管理模板-Windows组件-Windows更新  找到配置自动更新,将策略设置为未配置
  2. 继续找到策略“指定Intranet Microsoft更新服务位置”,设置为已启用,在指定位置中输入http://127.0.0.1,应用后关闭窗口;

     

posted @   stweily  阅读(224)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
历史上的今天:
2022-10-24 记录一个纯C#的小型本地文件NosqlDB-litedb
点击右上角即可分享
微信分享提示