当您的计算机出现问题时,Windows 系统(Windows system)文件可能会损坏或丢失。这可能是由各种问题引起的,例如突然断电、硬件故障、硬盘接近“死亡”等等。如果Windows报告由于某些文件损坏或丢失而无法启动,您应该使用命令提示符中的(Command Prompt)系统文件检查器(System File Checker)( SFC ) 工具。当Windows(Windows)启动蓝屏(Blue Screen)并出现奇怪的与损坏相关的错误时,您应该执行相同的操作。SFC扫描所有Windows系统(Windows system)计算机上的文件,识别损坏或丢失的文件,并尝试修复发现的问题。以下是如何使用它:
注意:(NOTE:)本教程适用于Windows 7和Windows 8.1。
Windows无法启动(Boot)时如何解决文件丢失或损坏的(Missing Or Corrupted)问题(Problems)
如果由于系统文件丢失或损坏而无法加载Windows ,请按照本教程启动(Windows)命令提示符(Command Prompt):如何在Windows无法启动时启动(Boot)命令提示符(Command Prompt)?
在命令提示符(Command Prompt)窗口中,使用带有两个附加参数的sfc命令:(sfc)
- /offbootdir - 用于指定包含引导Windows所需的系统文件的分区。在大多数情况下,此分区将是"C:"。
- /offwindir - 用于指定Windows 目录(Windows directory)的位置。在大多数情况下,此文件夹是"C:Windows"。
您将需要输入类似的内容:sfc /scannow /offbootdir=c: /offwindir=c:windows
然后按Enter。
此命令的“翻译”如下:扫描位于引导分区(boot partition)“C:”上的("C:")Windows 文件夹(Windows folder)并修复丢失或损坏的系统文件。
给(Arm)自己一些耐心,因为运行这个命令需要相当长的时间。当该过程完成时,您会被告知验证已 100% 完成。如果发现问题,也会通知您。无法修复的问题文件总是在名为CBS.log的(CBS.log)日志文件(log file)中提及。此文件位于Windows 文件夹(Windows folder)中,位于以下位置:“C:WindowsLogsCBSCBS.log”。
如果您的系统文件一切正常,您将收到一条消息:“Windows 资源保护未发现任何完整性违规”("Windows Resource Protection did not find any integrity violations")。
如何解决Windows(Windows Boots)启动时文件丢失或损坏的(Missing Or Corrupted)问题(Problems)
您可能还会发现自己处于Windows成功加载但随机崩溃并出现蓝屏死机(Blue Screen)((Death) BSOD )(BSOD)并提及损坏错误的情况。如果是这种情况,请以管理员身份启动命令提示符(Command Prompt),使用本教程中描述的任何方法:在Windows 7和Windows 8中启动(Windows 8)命令提示符(Command Prompt)的 7 种方法。
输入命令:sfc /scannow
然后按Enter。/scannow参数强制SFC 工具(SFC tool)扫描所有系统文件的完整性并尽可能修复有问题的文件。
再次,用一些耐心武装自己。该工具需要很长时间才能运行。至少几分钟。完成后,系统会通知您验证已 100% 完成。如果发现问题,也会通知您。
在我们的案例中,证监会(SFC)发现了损坏的文件,并且无法修复其中的一些文件。
无法修复的问题文件总是在名为CBS.log的(CBS.log)日志文件(log file)中提及。此文件位于Windows 文件夹(Windows folder)中,位于以下位置:“C:WindowsLogsCBSCBS.log”。
如何分析 CBS.Log 文件
转到“C:WindowsLogsCBS”并打开CBS.log。这个文件很大,在记事本(Notepad)中打开它需要一段时间。如果可能,请使用Notepad++或Microsoft Word等其他应用程序打开它,以便更快地打开它,并且您可以更轻松地使用它。
滚动(Scroll)到文件末尾并搜索(file and search)以文本开头的条目:“无法修复成员文件”("Cannot repair member file")。在那里,您将找到无法修复的丢失或损坏的系统文件。(system file)
在线(information online)搜索有关此日志文件(log file)中提到的文件的信息,从那里您可能会了解如何解决您的问题。
结论
希望(Hopefully)您永远不需要使用SFC 命令(SFC command)来修复Windows系统文件。但是,如果您确实有问题,请不要犹豫,考虑使用它。当您必须处理损坏或丢失的系统文件时,本教程应该会派上用场。
如果您正在寻找其他有用的故障排除教程,请阅读下面推荐的文章。
How To Repair Missing Or Corrupt Windows Files From The Command Prompt
When you have рroblems with your computer, Windows system files may become corrupted or go missіng. This might be caused by all kinds of isѕuеs like sudden рower drops, hardware malfunctions, a hard diѕk approaching its "death" and so on. If Windows rеports that it cannot start because some of its files arе corrupted or missing, you should use the System File Checker (SFC) tool in the Command Prompt. You should do the same when Windows starts to Blue Screen on you with weird corruption related errors. SFC scans all the Windows system files on your computer, identifies those that are corrupt or missing and tries to fix the problems it find. Here's how to use it:
NOTE: This tutorial applies to both Windows 7 and Windows 8.1.
How To Fix Problems With Missing Or Corrupted Files When Windows Won't Boot
If Windows doesn't load because of missing or corrupt system files, follow this tutorial to start the Command Prompt: How To Start The Command Prompt When Windows Doesn't Boot?.
In the Command Prompt window, use the sfc command with two additional parameters:
- /offbootdir - used to specify the partition that contains the system files that are required for booting Windows. In most cases, this partition is going to be "C:".
- /offwindir - used to specify the location of the Windows directory. In most cases, this folder is "C:Windows".
You will need to type something like: sfc /scannow /offbootdir=c: /offwindir=c:windows
and press Enter.
The "translation" for this command is the following: scan the Windows folder located on the boot partition "C:" and fix missing or corrupt system files.
Arm yourself with some patience because running this command will take quite a bit of time. When the process finishes, you are informed that the verification is 100% complete. If problems were found, you are also informed. The problematic files that cannot be fixed are always mentioned in a log file named CBS.log. This file is found in the Windows folder, at this location: "C:WindowsLogsCBSCBS.log".
If everything is fine with your system files, you will receive a message saying that: "Windows Resource Protection did not find any integrity violations".
How To Fix Problems With Missing Or Corrupted Files When Windows Boots
You may also find yourself in a scenario where Windows loads successfully but it crashes randomly with a Blue Screen of Death (BSOD) mentioning corruption errors. If that is the case for you, start the Command Prompt as an administrator, using any of the methods described in this tutorial: 7 Ways to Launch the Command Prompt in Windows 7 & Windows 8.
Type the command: sfc /scannow
and press Enter. The /scannow parameter forces the SFC tool to scan the integrity of all system files and repair problematic files when possible.
Again, arm yourself with some patience. The tool takes a long time to run. At least a couple of minutes. When it's done, you are informed that the verification is 100% complete. If problems were found, you are also informed.
In our case, SFC found corrupt files and it was unable to fix some of them.
The problematic files that cannot be fixed are always mentioned in a log file named CBS.log. This file is found in the Windows folder, at this location: "C:WindowsLogsCBSCBS.log".
How To Analyze The CBS.Log File
Go to "C:WindowsLogsCBS" and open the CBS.log. This file is quite large and it takes a while to open it in Notepad. If possible, open it with a different application like Notepad++ or Microsoft Word, so that it is opened faster and you have an easier time working with it.
Scroll towards the end of the file and search for entries that start with the text: "Cannot repair member file". There you will find the missing or corrupted system file(s) that cannot be repaired.
Search for information online about the file(s) mentioned in this log file and from there on you might get an idea on how to fix your problems.
Conclusion
Hopefully you will never need to use the SFC command to repair Windows systems files. However, if you do have issues, don't hesitate to consider using it. This tutorial should come in handy when you have to deal with system files being corrupted or missing.
If you are looking for other useful troubleshooting tutorials, read the articles recommended below.