如何从安装光盘修复损坏的系统文件


14

我正在使用Windows 8.1 x64,版本6.3.9600.16384,并使用具有管理员权限的命令提示符。

sfc /scannow

返回:

...found corrupt files but was unable to fix some of them.

dism /online /cleanup-image /restorehealth

返回:

Error: 0x800f0906
The source files could not be downloaded.

(由于缺少这些文件,因此Windows Update Service无法启动。)

也尝试过

dism /online /cleanup-image /restorehealth /source:wim:F:\sources\install.wim:1 /limitaccess

并返回:

Version: 6.3.9600.16384
Image Version: 6.3.9600.16384
Error: 0x800f081f
The source files could not be found.

我安装了图像,然后从那里尝试。

dism /mount-image /imagefile:F:\sources\install.wim /index:1 /mountdir:C:\offline

dism /online /cleanup-image /restoreHealth /source:c:\offline /limitaccess

还返回:

Error: 0x800f081f

如何修复损坏的系统文件?

我可以告诉DISM使用Windows安装光盘作为源吗?



@ and31415,有关该问题的发帖人讨论了他的问题,但该回答并没有解决我的问题。
卡洛斯·吉尔

1
然后,您可以将CSB.log文件(通常可以找到C:\Windows\Logs\CBS)复制到桌面上,将其压缩为.zip / .7z存档,然后将其上传到某个位置(例如ge.tt/about)。然后在此处发布结果链接以进行进一步检查。
and31415

干得好。这是CSB.log通过创建sfc /scannow CSB.log
卡洛斯·吉尔

Answers:


22

过滤细节

运行sfc /scannow会产生一个CBS.log报告文件(通常在中找到C:\Windows\Logs\CBS),其中包含大量信息。为了获得多汁的位,请打开命令提示符,然后执行以下命令:

findstr /i /c:"[SR]" "%windir%\Logs\CBS\CBS.log" | findstr /i /v /c:"verify" > "%userprofile%\Desktop\sfc.txt"

上面的命令将:

  1. 获取原始文件中包含的所有行,这些行[SR]用于跟踪修复尝试。

  2. 删除verify上一步中包含的所有行,以进一步减少混乱。

  3. 将结果写入sfc.txt文件中以供以后分析。

在这种情况下,这将是结果文件:

2014-02-19 17:08:47, Info                  CSI    0000008b [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-Main, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:08:49, Info                  CSI    0000008c [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-Main, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:08:49, Info                  CSI    0000008d [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"
2014-02-19 17:08:51, Info                  CSI    00000091 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:08:53, Info                  CSI    00000092 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:08:53, Info                  CSI    00000093 [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"
2014-02-19 17:08:56, Info                  CSI    00000097 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-MediaViewerDistributed-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:08:57, Info                  CSI    00000098 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-MediaViewerDistributed-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:08:57, Info                  CSI    00000099 [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"
2014-02-19 17:23:00, Info                  CSI    00000975 [SR] Repairing 3 components
2014-02-19 17:23:00, Info                  CSI    00000977 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-Main, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    00000978 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    00000979 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-MediaViewerDistributed-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    0000097a [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    0000097b [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"
2014-02-19 17:23:00, Info                  CSI    0000097c [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-Main, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    0000097d [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"
2014-02-19 17:23:00, Info                  CSI    0000097e [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-MediaViewerDistributed-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    0000097f [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"
2014-02-19 17:23:00, Info                  CSI    00000980 [SR] Repair complete
2014-02-19 17:23:00, Info                  CSI    00000981 [SR] Committing transaction

找出问题

检查文件后,您可以看到系统文件检查器试图修复3个组件,但是失败了:

2014-02-19 17:23:00, Info                  CSI    00000975 [SR] Repairing 3 components
2014-02-19 17:23:00, Info                  CSI    00000977 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-Main, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    00000978 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-LockScreenCamera-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
2014-02-19 17:23:00, Info                  CSI    00000979 [SR] Cannot repair member file [l:22{11}]"Generic.xbf" of Microsoft-Windows-Camera-MediaViewerDistributed-MediaShared, Version = 6.3.9600.16485, pA = PROCESSOR_ARCHITECTURE_AMD64 (9), Culture neutral, VersionScope = 1 nonSxS, PublicKeyToken = {l:8 b:31bf3856ad364e35}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing

每个条目都遵循以下粗略方案:

  • Cannot repair member file [...]"Generic.xbf"
    需要修复的文件。

  • of Microsoft-Windows-Camera-LockScreenCamera-Main,
    文件所属的软件包的名称。

  • Version = 6.3.9600.16485,
    文件版本(主要,次要,内部版本和修订版)。

  • pA = PROCESSOR_ARCHITECTURE_AMD64 (9),
    目标处理器架构

  • Culture neutral, [...],
    如果是本地语言,则为 中性或相关的文化名称

  • file is missing
    原因文件需要修复。

Generic.xbf缺少三个文件。此外,它们所有人都共享以下信息:

2014-02-19 17:23:00, Info                  CSI    0000097b [SR] This component was referenced by [l:154{77}]"Package_1_for_KB2914218~31bf3856ad364e35~amd64~~6.3.1.3.2914218-1_neutral_GDR"

这意味着该文件包含在KB2914218 Windows更新中。

手动维修

  1. 获取KB2914218更新程序包。

  2. .msu使用7-Zip提取以原始文件命名的文件夹中的下载文件(例如Windows8.1-KB2914218-x64)。

  3. 以管理员身份打开命令提示符,并使用以下命令导航到实际文件夹:

    cd /d "X:\Whatever\Windows8.1-KB2914218-x64"
    
  4. 展开包含当前目录中更新文件的文件柜档案:

    expand Windows8.1-KB2914218-x64.cab -f:* %cd%
    
  5. 每个软件包都有一个关联的.manifest文件,其中列出了捆绑的文件。为了确定每个文件的存储位置,请通过替换packagaNamefileName.ext使用实际值来运行以下命令:

    for /f "delims=" %A in ('"findstr /i /m /c:"packageName" *.manifest"') do @for /f "delims=" %B in ('"findstr /i /m /c:"fileName.ext" %A"') do @echo %~nB;fileName.ext>>fixes.txt
    

    例如:

    for /f "delims=" %A in ('"findstr /i /m /c:"Microsoft-Windows-Camera-LockScreenCamera-Main" *.manifest"') do @for /f "delims=" %B in ('"findstr /i /m /c:"Generic.xbf" %A"') do @echo %~nB;Generic.xbf>>fixes.txt
    
  6. 对任何其他需要修复的文件重复步骤5。

  7. 取得所有权并完全控制该C:\Windows\winsxs文件夹:

    takeown /f "%windir%\winsxs" /a
    icacls "%windir%\winsxs" /grant:r *S-1-5-32-544:(OI)(CI)(F) /q
    
  8. 创建任何丢失的文件夹:

    for /f "tokens=1 delims=;" %G in (fixes.txt) do @if not exist "%windir%\winsxs\%~G\" @md "%windir%\winsxs\%~G"
    
  9. 完全控制所需的文件夹:

    for /f "tokens=1 delims=;" %G in (fixes.txt) do takeown /f "%windir%\winsxs\%~G" /a >nul & icacls "%windir%\winsxs\%~G" /grant:r *S-1-5-32-544:(OI)(CI)(F) /q
    
  10. 恢复文件:

    for /f "tokens=1,2 delims=;" %A in (fixes.txt) do copy /y ".\%A\%B" "%windir%\winsxs\%A\%B"
    
  11. 重复系统文件检查以确保问题已解决:

    sfc /scannow
    

参考文献


谢谢。SFC /SCANNOW之后没有发现任何问题。
卡洛斯·吉尔

哇,太神奇了!您为什么不在Augustforums.com或类似的网站上编写教程?
Milind R 2014年

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.