Launch the System File Checker utility. Checking and restoring the integrity of Windows system files

Doesn't work correctly, you can use the SFC command line utility to recover damaged or lost system files.

When you start noticing random errors, problems while booting your system, or problems with Windows components, there's a good chance that the condition is caused by corrupted or lost system files.

Even though Windows 10 does a great job of protecting the files that are essential for your computer to function properly, some apps, drivers, or even Windows updates can cause your system to become unstable. Like previous versions of Microsoft systems, Windows 10 includes System File Checker (SFC), a compact but powerful command-line utility that can perform a system integrity scan and replace damaged or missing files with the original version.

In this guide, we will present steps to use System File Checker (SFC) to automatically repair corrupted system files while the operating system is running. We'll also look at how to run the utility in Safe Command Prompt Mode and how to manually restore damaged system files that caused problems.

Warning: Before you start using the SFC utility, it is recommended that you make a full backup of your system or create a system restore point. In case something goes wrong, you can return the system to its original state.

The following command allows you to perform a full scan of protected files on your computer and fix files that are causing problems while running Windows 10.

Command line

Sfc /scannow

3. Once the scan is complete, you will see one of the following messages:

  • Windows Resource Protection detected no integrity violations. This means that there are no damaged or lost files found on the system.
  • Windows Resource Protection cannot perform the requested operation. This message means that an error occurred during scanning and you need to scan offline.
  • Windows Resource Protection detected corrupted files and successfully repaired them. See CBS.Log WinDir%\Logs\CBS\CBS.log for information. This message appears when SFC was able to correct the problem. You can view the magazine for detailed information.
  • Windows Resource Protection has detected corrupted files, but is unable to repair some of them. See CBS.Log %WinDir%\Logs\CBS\CBS.log for information. In this case, you need to manually fix the damaged files.
Advice: To correct all problems, you may need to go through the integrity check procedure about three times.

To view information about the operation of the integrity checker in the CBS.Log file, you need to create a readable copy of the file on your desktop:

1. Search for Start menu Command line, right-click on the link that appears and select Run as administrator.

2. Type the following command and press Enter

Findstr /c:"" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfclogs.txt"

3. Open the sfclogs.txt file located on your desktop using Notepad. The file will contain detailed information about the system scan and files that could not be recovered.

Note: detailed information is available only when performing a scan in Windows 10, but not when running the utility in Safe Mode in the Command Prompt.

Sometimes protected system files that need to be restored are already loaded into RAM while WIndows 10 is running. In this case, you can use the System File Checker during system startup to fix any detected problems.

  • 1. Use the Windows keyboard shortcut + I to open the Settings application.
  • 2. Select the “Update and Security” section.
  • 3. From the menu, select the “Recovery” option.
  • 4. In the “Special Boot Options” section, click the “Restart Now” button.

  • 5. Select “Troubleshooting”.
  • 6. Go to “Advanced Settings”.
  • 7. Click “Command Prompt” to boot your computer into command line mode.


  • 8. After rebooting, you will need to enter your username and password.
  • 9. You need to tell SFC where the Windows installation files are located. At the Command Prompt, enter the following command to recognize the location of Windows 10 files and system reserved partitions:

  • 10. Type the following command and press Enter:
sfc /scannow /offbootdir=C:\ /offwindir=D:\Windows

Note that the example uses the /offboodir switch to specify the drive letter of the system-reserved partition. In this case, this is drive C, and the /offwindir switch specifies the path to the Windows files, which in our case is D:\Windows.

You need to remember that when you boot your computer in command line mode, the drive letters may be different, so you need to use the command specified in step 9. However, in most cases when working with Windows 10, drive D is used for installation, and drive C is reserved System Reserved partition.

  • 11. After scanning is completed, close the command prompt.
  • 12. Click “Continue” to exit and boot into Windows 10 as usual.

How to manually restore system files in Windows 10

If System File Checker fails to fix one or more files, you will have to restore them manually.

Open the sfclogs.txt file to determine which files were corrupted. Perform a basic search to find file locations or use a search engine to find more information. Then follow the instructions below to replace the damaged files.

Advice: You may be able to find working versions of system files on another computer that has the same version of the operating system as the original computer.

  • 1. Search for Start menu Command line, right-click on the link that appears and select Run as administrator because device administrator rights are required to run SFC.
  • 2. At the Command Prompt, type the following command and press Enter:
takeown /f C:\Path-and-File-Name

Note: Replace C:\Path-and-File-Name with the path of the damaged file. For example:

C:\Windows\System32\appraiser.dll

  • 3. Allow full access (administrator access) to the corrupted files by using the following command and pressing Enter.
icacls C:\Path-and-File-Name /Grant Administrators:F
  • 4. Replace the problematic file with a working copy, enter the following command and press Enter:
copy C:\Path-SOURCE-and-File-Name C:\Path-DESTINATION-and-File-Name

Note: Replace C:\Path-SOURCE-and-File-Name with the path and name of the working version of the file, and C:\Path-DESTINATION-and-File-Name should be replaced with the path and name of the damaged file. For example:

Copy D:\Files\appraiser.dll C:\Windows\System32\appraiser.dll

  • 5. Type “Yes” and press Enter to confirm the overwrite.

After replacing the file, you can enter the SFC /verifyonly command and press Enter at the Command Prompt to verify the integrity of all system files to ensure that the problem has been resolved. Additionally, if only some files have been corrected, you can verify the integrity of each individual file using the command sfc /VERIFYFILE=C:\Path-and-File-Name . For example:

Sfc /VERIFYFILE=C:\Windows\System32\kernel32.dll

Keep in mind that System File Checker can be used not only on Windows 10, but also on previous versions of the operating system. However, depending on the OS version, some features may differ. At the Command Prompt, enter the command sfc /? to view all available options.

Found a typo? Press Ctrl + Enter

If there are problems with your computer, it’s a good idea to check the OS to determine the integrity of the system files. It is the damage or deletion of these objects that often causes the PC to malfunction. Let's see how you can perform this operation in Windows 7.

If you notice any errors in the operation of your computer or its incorrect behavior, for example, the periodic appearance of a blue screen of death, then, first of all, it is necessary. If this check does not reveal any faults, then in this case you should resort to scanning the system for the integrity of system files, which we will discuss in detail below. This operation can be performed either by using the capabilities of third-party software or by using the launch of the embedded Windows 7 utility "SFC" through "Command line". It should be noted that even third-party programs are used only to activate "SFC".

Method 1: Windows Repair

One of the most popular third-party programs for scanning your computer for damaged system files and restoring them if problems are detected is.


We will talk in more detail about the operation of this utility when reviewing Method 3, since it can also be launched by using Microsoft-introduced operating system tools.

Method 2: Glary Utilities

The next comprehensive program for optimizing computer operation, with which you can check the integrity of system files, is. Using this application has one important advantage over the previous method. It lies in the fact that Glory Utilities, unlike Windows Repair, has a Russian-language interface, which makes the task much easier for domestic users.


More detailed information about the work "SFC" presented when considering the following method.

Method 3: "Command Line"

Activate "SFC" to scan for damage to Windows system files, you can use exclusively OS tools, specifically "Command line".


Attention! In order for SFC to not only check the integrity of system files, but also restore them if errors are detected, it is recommended to insert the operating system installation disk before starting the tool. This must be the exact disk from which Windows was installed on this computer.

There are several variations of using the product "SFC" to check the integrity of system files. If you need to scan without restoring missing or damaged OS objects by default, then "Command line" you need to enter the command:

If you need to check a specific file for damage, you should enter a command that matches the following pattern:

sfc /scanfile=file_address

There is also a special command to check an operating system located on a different hard drive, that is, not the OS in which you are currently working. Its template looks like this:

sfc /scannow /offwindir=Windows_directory_address

Problem launching "SFC"

When trying to activate "SFC" a problem may occur that "Command line" A message will be displayed indicating that the recovery service failed to activate.

The most common cause of this problem is disabling a system service. "Windows Module Installer". To be able to scan your computer with the tool "SFC", it must be turned on.

  1. Click "Start", go to "Control Panel".
  2. Come in "System and safety".
  3. Now press "Administration".
  4. A window will appear with a list of various system tools. Click "Services" to make the transition to "Service Manager".
  5. A window opens with a list of system services. Here you need to find the name "Windows Module Installer". To make your search easier, click on the column name "Name". The elements will be built according to the alphabet. Having found the desired object, check what value is in its field "Startup type". If there is an inscription "Disabled", then you should enable the service.
  6. Click RMB by the name of the specified service and select from the list "Properties".
  7. The service properties shell opens. In chapter "Are common" click on the area "Startup type", where the value is currently set "Disabled".
  8. A list opens. Here you should select a value "Manually".
  9. Once the required value is set, click "Apply" And "OK".
  10. IN "Service Manager" in a collumn "Startup type" in the line of the element we need, the value is set to "Manually". This means that you can now run "SFC" via the command line.

As you can see, you can run a computer scan for the integrity of system files either using third-party programs or using "Command line" Windows. However, no matter how you run the check, the system tool still performs it "SFC". That is, third-party applications can only make launching the built-in scanning tool easier and more intuitive. Therefore, specifically in order to carry out this type of check, there is no point in downloading and installing software from third-party manufacturers. True, if it is already installed on your computer for general system optimization purposes, then, of course, you can use it to activate "SFC" these software products, since it is still more convenient than operating traditionally through "Command line".

As a result of some Windows 7 malfunctions and malware infections, there is a need to analyze the file integrity of the system. Also, files are often damaged due to improper shutdown of the PC and power surges. Therefore, every “Seven” user should be able to independently check and resuscitate system files on a computer with Windows 7.

File analysis method

The main tool for checking and analyzing their integrity in “Seven” is the “SFC.exe” application built into the OS, which can also restore defective files. Regular use of the command to perform the “sfc /scannow” scan will ensure the smooth operation of Windows 7. It is recommended to use it at least once every six months.

Analysis procedure

The built-in scan tool in Windows 7 runs as follows:

Note: Do not close the console until the procedure is complete. Upon completion, the results of the completed program will appear.

  1. Restart your computer;
  2. Ready. The system integrity check has been completed and the corrupted files have been fixed.

Sometimes it happens that an application cannot cope with fixing damaged files on its own. In such cases, it is recommended to perform analysis in safe mode, but even if this does not resolve the problem, you need to run: “findstr /c:” “%windir%\Logs\CBS\CBS.log >”%userprofile%\Desktop\sfc .txt".

After this, a “txt” file will appear on the Windows 7 desktop with a list of all files that the program is not able to resuscitate itself. The user needs to copy these files to himself from another computer, but with a working Windows 7, or from an external installation media with a distribution kit of the “Seven” modification that runs on the user’s PC.

Algorithm for restoring a damaged file manually

Now, knowing the exact name and location of the problematic file that the application could not fix automatically, you need to replace it. To this end, it is necessary to take the following sequential steps:


What if the SFC.exe application does not work at all?

It happens that the utility cannot even start. In such a situation, you should analyze the performance of the following applications:

  1. Remote Procedure Call Locator;
  2. Remote procedure call;
  3. Starting DCOM server processes.

If these programs are functioning normally, "SFC.exe" will start.

Also, the utility will not cope with its functions when the manual startup type of the recovery service is activated in the Windows Module Installer service.

Additional analysis methods via "SFC"

If you need, for example, to analyze the integrity of files on a remote OS or solve various other problems, then there are several of the following effective techniques:

  1. It is possible to carry out a check without a subsequent recovery process. To do this, using the algorithm of the instructions given above, you need to use the command “sfc /verifyonly”.
  2. If necessary, you can resuscitate only a specific file by typing in the console: “sfc /scanfile=Location”.
  3. In a situation where you need to analyze Windows installed on another logical partition of the hard drive, the command will help: “sfc /scannow /offwindir=Windows directory location.”

Conclusion

Some users, at their own discretion, modify files, change icons in Explorer, and the like. After the application works to analyze and correct the integrity of the OS, all adjustments made will be canceled and will again take the default form. Therefore, such computer owners will need to perform all their system modification operations again after the utility has completed its work.

The System File Checker built into Windows can check system files for damage and any other changes. If the file has been modified, the utility will automatically replace it with the correct version.

When to use these commands

These commands are useful when diagnosing a faulty Windows operating system. If the system displays a blue screen, applications crash, or some system functions do not work, the SFC command can help. Even if executing the SFC command does not fix anything, this will allow you to verify that the system files are not damaged and you can continue diagnostics in other ways.

The DISM command is not required under normal circumstances. But if the SFC command fails or fails to replace damaged files with normal ones, DISM or System Update Readiness Tool can fix the operating system itself and allow the SFC command to run normally.

Fixing system files with the SFC command

The SFC command must be run as an administrator. To do this, in Windows 10 or 8.1, right-click on the Start icon and select the Command Prompt (Admin) option. Additionally, in all versions of Windows, you can search the Start menu/Start screen for “command prompt,” right-click the link, and select “Run as Administrator.”

To perform a full system scan, enter the following command in the command prompt window and press :

Do not close the window until the command completes. The process can be quite lengthy. If everything is in order, at the end of the scan the message “Windows Resource Protection did not find any integrity violations” will appear.

If you see the message “Windows Resource Protection found corrupt files but was unable to fix some of them,” first try booting your system into Safe Mode. In Windows 10, 8.1 or 8, to do this, hold down the key when selecting the “Restart” option in the shutdown menu to get to the screen for selecting additional boot options. In Windows 7 and earlier versions, restart your computer and hold down the key during startup. After booting into safe mode, run the sfc /scannow command again.

Fixing SFC problems with the DISM command

In Windows 10, 8.1, and 8, you can use the Deployment Image & Servicing Management (DSIM) tool to fix component store corruption that is preventing SFC from working properly.

To run this tool, open a Command Prompt window as an administrator, type the following command, and click . DISM will check the Windows Component Store for corruption and automatically fix any problems found.

DISM /Online /Cleanup-Image /RestoreHealth

Do not close the Command Prompt window until the process is complete. The verification may take up to 10 minutes. If the progress bar stays at 20% for a long time, don’t worry, this is normal.

If any changes are made as a result of running the DISM command, restart your computer. Once done, run the SFC command again and it will be able to replace the corrupted files with the correct ones.

In Windows 7 and earlier versions, the DISM command is not available. Instead, you can download the System Update Readiness Tool from the official Microsoft website, which allows you to check your system for problems and try to fix them.

Restoring the system or restoring it to its original state

If problems persist and these tools cannot correct them, more drastic measures can be taken. The System Restore tool allows you to return Windows to an earlier state, which will solve the problem if the operating system was still working in that state.

You can also reset Windows to its factory state or reinstall it. In Windows 10, 8.1 and 8, you can use the Computer Restore (Restore) feature, which allows you to return Windows to its original state. After this, you will have to reinstall all programs, but user files will not be affected. In Windows 7 and earlier, you should use a recovery partition created by your computer manufacturer, or simply reinstall Windows from scratch.

If you encounter other errors when running the commands described above, try searching for their description on the Internet. Often the command output contains information about log files that can provide more detailed information about specific problems. And in the end, there's no need to waste time diagnosing complex problems when you can simply perform a factory reset or reinstall Windows.

The commands described above have other options. For example, you can use SFC to check and fix individual system files. And with DISM, you can perform a quick system scan without fixing it, or point the utility to a WIM or ESD file containing Windows system files.

Materials

). In this case, some begin to worry and look for all sorts of reasons and ways to eliminate freezes.
I will not repeat myself and write why this happens, because... The article is not about this and I have already given a link to solving problems above.
I’d rather show you one interesting way that will help you check the system for errors.

Few people know, but in Windows OS there is one useful “little thing” that can itself search And correct errors in the system itself. Moreover, it will not touch third-party programs, but will only check its system files. This is useful and interesting because many do not think that the reason may be hidden in the system itself, but feverishly begin, and so on. All in all . Yes, this is useful and can lead to good results, but with all these actions it is good to remember what I will write about below.

I already wrote a little about this function in the article, which can also arise due to a failure in system files, which are often forgotten. But still, within the framework of this article, I will repeat...

So, let's run:

and enter it into sfc /scannow:


The system check will begin:


All you have to do is wait.

For those interested, here is a description of the command and keys.

sfc
Where:
/scannow – immediately scans all protected system files.
/scanonce – scans all protected system files once at the next system boot.
/scanboot – scans all protected system files at every boot
/REVERT – Sets the initial parameters to default.
/ENABLE – Enable normal operation of Windows file protection
/PURGECACHE – Clear file cache and check files immediately
/CACHESIZE=x – Sets the file cache size

In the command line (Start -> Run -> cmd) we write the command sfc / and the desired key.

After the check is completed, the system will report the results and ask you to reboot.

That's all I have. Thank you all for your attention.