在我的操作系统出现一些问题之后(Windows 8.1 专业版),我决定运行旧的SFC /scannow
,它发现并修复了一些损坏的文件。
CBS日志报告:
2019-10-05 06:52:37, Info CSI 00000b2e [SR] Repairing 1 components
2019-10-05 06:52:37, Info CSI 00000b2f [SR] Beginning Verify and Repair transaction
2019-10-05 06:52:37, Info CSI 00000b30 [SR] Repairing corrupted file [ml:520{260},l:92{46}]"\??\C:\ProgramData\regid.1991-06.com.microsoft"\[l:106{53}]"regid.1991-06.com.microsoft_Windows-8.1-Pro-N.swidtag" from store
2019-10-05 06:52:37, Info CSI 00000b33 [SR] Repair complete
2019-10-05 06:52:37, Info CSI 00000b34 [SR] Committing transaction
2019-10-05 06:52:37, Info CSI 00000b39 [SR] Verify and Repair Transaction completed. All files and registry keys listed in this transaction have been successfully repaired
第二次扫描没有发现任何完整性违规。
然后我尝试使用 DISM,命令如下:
DISM /Online /Cleanup-image /RestoreHealth
但我明白source files not found
。
因此我下载了 Windows 8.1 iso,并检查了我的安装的版本: winver 和 WIM 信息
之后,我使用适当的命令通过本地源执行 DISM:
DISM /Online /Cleanup-Image /RestoreHealth /Source:wim:G:\sources\install.wim:1 /LimitAccess
但是,我再次遇到同样的错误。
因此我检查了 DISM.log 文件,发现了这个错误:
2019-10-05 14:20:40, Info DISM DISM Package Manager: PID=2784 TID=1744 Error in operation: source for package or file not found, ResolveSource() unsuccessful. (CBS HRESULT=0x800f081f) - CCbsConUIHandler::Error
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 Failed finalizing changes. - CDISMPackageManager::Internal_Finalize(hr:0x800f081f)
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 Failed processing package changes with session option CbsSessionOptionRepairStoreCorruption - CDISMPackageManager::RestoreHealth(hr:0x800f081f)
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 Failed to restore the image health. - CPackageManagerCLIHandler::ProcessCmdLine_CleanupImage(hr:0x800f081f)
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 Failed while processing command cleanup-image. - CPackageManagerCLIHandler::ExecuteCmdLine(hr:0x800f081f)
2019-10-05 14:20:40, Info DISM DISM Package Manager: PID=2784 TID=7928 Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log - CPackageManagerCLIHandler::ExecuteCmdLine
更具体地说:
2019-10-05 14:20:40, Error DISM DISM Package Manager: PID=2784 TID=7928 The source files could not be found; their location must be specified using the /source option to restore the feature. - GetCbsErrorMsg
即使我刚刚这样做了!因此,因为日志报告后有几行:
Further logs for online package and feature related operations can be found at %WINDIR%\logs\CBS\cbs.log
我用 Notepad++ 打开 CBS.log(里面有超过 11K 行的日志)并在其中发现了一个 SYN。
截屏:
所以,我的问题是:怎么会发生这种事?而且当然我该如何修复这个问题?
更多信息:Windows 更新工作正常(我猜),但最近我刚登录后就收到一些有关远程过程调用的错误消息(使用任务管理器,有时甚至使用资源管理器,当我尝试操作文件夹时,但只是第一次)。有几次我在登录时输入密码时收到相同的错误。
答案1
由于这两个命令的基本目的,您永远不应该SFC /ScanNow
在运行之前运行:DISM /Online /Cleanup-Image /RestoreHealth
- DISM
/RestoreHealth
会检查其中包含的所有系统文件的备份%WinDir%\WinSxS
与来自 Windows 更新服务器的已知良好副本。- 有时
/RestoreHealth
可能会由于组件存储 [WinSxS
] 脏而失败:DISM /Online /Cleanup-Image /StartComponentCleanup
- 有时
- SFC
/ScanNow
检查 中的所有系统文件%WinDir%
(不包括WinSxS
)是否与 中包含的已知良好备份副本相符WinSxS
。
通过首先运行 SFC,用户不知道 Windows 组件存储中的备份文件(SFC 依靠该文件进行哈希比较来检查是否损坏)是否损坏;
DISM 可以确保这一点。
- 连接到互联网
DISM /Online /Cleanup-Image /StartComponentCleanup
互联网:
DISM /Online /Cleanup-Image /RestoreHealth
无互联网访问或以上操作失败:安装
install.wim
通常包含 4 张图片,始终至少包含 2 张图片
笔记:
长期以来,Win8.1 上的 DISM 无法获取 WIM,尝试时会出错。
我不确定 KB 何时/哪个版本应用了修复程序 - 为了避免混淆,我始终建议不要直接获取 WIM,而是安装它并WinSxS
直接获取。# Create Mount Directory: mkdir "C:\Mount" # Get image index for installed version of Windows: DISM /Get-WIMinfo /WIMfile:"Z:\install.wim" # Mount image index: DISM /Mount-Image /ImageFile:"Z:\Install.wim" /Index:<#> /MountDir:"C:\Mount" /ReadOnly # Specify WinSxS source for DISM: DISM /Online /Cleanup-Image /RestoreHealth /Source:"C:\Mount\Windows\WinSxS"
SFC /ScanNow