Windows 更新卡住:用命令行诊断并修复
针对 Windows 更新卡住的排查指南:查看更新历史、修复系统文件与组件存储、重置更新组件,并用 PowerShell 直接安装。
快速开始
当 Windows 更新在同一个百分比上停好几个小时,原因通常是下载缓存损坏、更新服务卡死或系统文件受损。本指南从诊断、修复到验证逐步带您排查,所有命令均可在管理员终端中运行。
症状
先查看已安装了哪些更新
动手之前,先确认那个“卡住”的更新到底是没装上,还是其实已经装好只是没显示。这决定了你要排查的是安装失败还是状态显示问题。看到一串带安装日期的 KB 编号列表,就说明这一步成功了。
被遗忘的 Get-HotFix cmdlet 一行命令即可回答"KBxxxxxxx 装了吗",本地远程都适用。
$ Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 10 HotFixID, Description, InstalledOn用 SFC 修复系统文件
系统文件损坏是 Windows 更新安装中途卡住的常见原因。运行一次完整的系统文件检查,让它自动替换受损文件。扫描结束提示“未发现完整性冲突”或“已修复损坏文件”,即表示成功。
使用系统文件检查器逐一校验受保护的系统文件,并用完好的副本自动替换损坏的文件。
$ sfc /scannow用 DISM 修复组件存储
如果 SFC 无法完全修复,可能是因为它依赖的组件存储本身已损坏——而 Windows 更新正是从这个存储里安装的。运行 DISM RestoreHealth 修复它。进度到 100% 并提示操作成功完成,即表示成功。
使用 DISM 工具检测并修复 Windows 组件存储的损坏,这是 SFC 修复系统文件所依赖的底层来源。
$ DISM /Online /Cleanup-Image /RestoreHealth重置 Windows 更新组件
下载缓存损坏或更新服务卡死,是更新卡在某个百分比不动最典型的原因。先停止 BITS、Windows 更新和加密服务,重命名 SoftwareDistribution 缓存目录,再重启这些服务,让更新从头重新下载。所有服务都能正常停止和启动,即表示成功。
停止更新相关服务,重命名 SoftwareDistribution 下载缓存,再重新启动服务。
$ net stop bits
net stop wuauserv
net stop cryptsvc
ren %Systemroot%\SoftwareDistribution\DataStore DataStore.bak
ren %Systemroot%\SoftwareDistribution\Download Download.bak
net start bits
net start wuauserv
net start cryptsvc改用 PowerShell 安装更新
如果设置界面里的更新依然不动,可以完全绕过它:PSWindowsUpdate 模块能在命令行中搜索、下载、安装更新并自动重启,在设置界面失败时往往能成功。更新显示已安装、机器正常重启,即表示成功。
不打开设置界面,直接命令行搜索、下载、安装更新并重启,远程会话和服务器尤其方便。
$ Install-Module PSWindowsUpdate -Force
Get-WindowsUpdate
Install-WindowsUpdate -AcceptAll -AutoReboot确认更新已安装成功
修复并重启后,重新列出已安装更新,确认之前卡住的那个 KB 编号已经出现,且安装日期是最新的。列表中能看到该 KB 编号,就说明问题已解决。
从 PowerShell 查询所有已安装热修复的补丁号、类型和安装日期,是确认某个 KB 补丁是否真正落地的最快方法。
$ Get-HotFix | Sort-Object InstalledOn -Descending | Format-Table HotFixID, Description, InstalledOn -AutoSize如何确认已解决
重启电脑后重新列出已安装更新,确认之前等待的那个 KB 编号已经出现,且安装日期为最新。
来源
- sfc | Microsoft Learn依据: Microsoft documents that 'sfc /scannow' scans the integrity of all protected system files and replaces incorrect versions with correct Microsoft versions.
- Additional resources for Windows Update - Windows Client | Microsoft Learn依据: Stop the BITS service, the Windows Update service and the Cryptographic service... net stop bits / net stop wuauserv / net stop cryptsvc ... Restart the BITS service, the Windows Update service and the Cryptographic service. net start bits / net start wuauserv / net start cryptsvc
- Get-HotFix - List installed hotfixes - PowerShell依据: SS64 shows Get-HotFix usage and notes it wraps the Win32_QuickFixEngineering WMI class for querying installed updates.
- System File Checker (sfc) - Windows CMD依据: SS64 describes the /scannow switch as scanning all protected system files immediately and repairing problems found.
- Net - Services, File/Print shares, Permissions command - Windows CMD依据: Net - Services, File/Print shares, Permissions command - Windows CMD SS64 CMD How-to NET.exe The NET Command is used to manage network resources as follows: NET ACCOUNTS, GROUP, LOCALGROUP - Account settings and group members. NET COMPUTER, CONFIG_ - Network configuration (Workstation/Server). NET FILE, SESSIONS - Manage open files and user sessions. NET HELP, HELPMSG - Help. NET PRI
- Get-HotFix (Microsoft.PowerShell.Management)依据: Documents Get-HotFix listing installed hotfixes, including filtering by HotFixID (KB number) or description, and querying remote computers via -ComputerName.
- What is DISM? | Microsoft Learn依据: Microsoft describes DISM as a tool that services Windows images, including repairing the component store of a running online image.
- PSWindowsUpdate依据: Module page documenting Get-WindowsUpdate and Install-WindowsUpdate cmdlets built on the Windows Update Agent API.
最后验证: 2026-09-21