Checking Windows for integrity. Using the standard SFC utility. Running SFC using the recovery environment

Hello friends! This article is a logical continuation of the recently launched epic about the fight against. And now the author will share with you one more effective method eliminate such troubles.

Therefore, the topic of the story will sound like this: the SFC scannow command in Windows 7 and 10. We will also consider the question of why sometimes it cannot restore system files. That is, simply put, it refuses to work.

So, what kind of command is this and what is it for? So, SFC scannow is system utility, which serves for automatic check and recovery important files operating system.

It is quite easy to use, but sometimes various nuances may arise. So let's get down to business to understand everything. All further actions will be shown on Windows example 10, although in Win 7 everything is done almost the same way.

Then enter the command itself:

The system scan process will begin, which may take quite some time. long time. So now all we can do is wait and hope that this command can fix everything.

After finishing the work, a report will appear, which will tell you about real situation business You will also have the opportunity to familiarize yourself with the log file and understand in detail the important details:

But as you can see in the screenshot above, in our case everything did not go very smoothly. Damaged files were detected, but Windows 10 was unable to restore them.

This happens because the SFC scannow parameter is unable to restore those system files that are used in this moment time by the operating system itself. In general, a real paradox emerges.

But nevertheless, there is a way out of this situation. You need to try to perform the above actions in the environment Windows recovery. How to enter it on the tenth version of the system is described in great detail in

Well, on the seven you will have to use a previously prepared boot disk and set it as priority on the computer. Alas, there is no other way.

Well, we continue the process of treatment and file recovery using Win 10 as an example. And now you will need to enter a small series of commands. The first one will be like this:

With the next function we will print common list installed on computer hard disks. Each of them has already been assigned personal number, which we will need in the next step:

Now select the disk number zero discovered above, since it is the only one in the system:

At this stage, all that remains is to sort out the hard drive in order to understand which one is the system one, that is, with Windows installed:

After necessary information received, you can, so to speak, and move on from here. To do this, enter next command:

And now, finally, the hour of truth has come. Now we will check the system files again and, in case of problems, try to restore them. So, let's start the process:

In this expression, the letter "C" indicates logical hard section disk on which the operating system is installed. Also, when entering, it is very important to ensure that the input is correct, in particular, to put problems where necessary.

Now we can only hope that after the scanning process is completed, the message “Protection Windows resources did not detect any integrity violations.”

What else can you tell about the SFC scannow command? For example, this parameter will be able to display a log with the results of work on the desktop in the recovery environment:

And the following method will allow you to check and restore a specific file. For example, in work Windows given the parameter will look like this:

Where "kernel32.dll" represents the name the desired file. And the entire expression is the path to the directory where it is located. The exact same command in the Windows 7 and 10 recovery environment will be slightly different:

Well, friends, now you know why sometimes the SFC scannow command in Windows 7 and 10 cannot restore system files. But in conclusion, it’s worth saying that there is another similar utility, which we also .

If you suddenly have any questions, feel free to ask them in the comments to the article. Now you can relax a little and watch a very interesting video. Guys, you definitely need to watch this.

No user is immune from errors in the Windows 10 operating system. They can arise due to its purposeful or accidental interference in the operation of the OS, as well as due to the fault third party applications. If the operating system begins to complain about missing files, registry errors, or the inability to read items from Windows folders, you will need to check the integrity of its components.

The Windows 10 operating system provides 2 methods for analyzing file integrity - through the SFC.exe and DISM.exe tools. The commands do not replace each other, but complement each other, checking various system libraries for file integrity. That is why it is recommended to do not one of them, but both. Tools will allow you to check the integrity Windows files 10 and replace damaged or altered items with original ones.

Important: If the computer user previously made reasonable changes to the system files of the operating system, they will be canceled. Windows Tools will replace the changed elements with the original ones, even if the problem in the operation of the computer or application is not caused by their actions.

How to check file integrity in Windows 10 using SFC

It is recommended to start checking the integrity of operating system files with the SFC command. It allows you to find errors in key files and fix them. You can check using SFC as in familiar interface Windows 10 through the command line and through the recovery environment, both of these methods are described below.

Via the command line in the Windows interface

It is better to start checking using SFC through the standard Windows interface using the command line. Most often this is enough. To check the integrity of the files you need to do the following:


If there are no problems with the Windows system files, after checking the user will see a message that “Windows Resource Protection did not detect an integrity violation.” In such a situation, you can proceed to checking files using DISM.

However, in some situations, files that are responsible for displaying may not work correctly. GUI Windows and the system will not be able to fix them, since they are active. In such cases it is necessary to carry out SFC check through a recovery environment that does not require loading a graphical interface and is capable of working with these files, as well as changing them if necessary.

Please note if you suspect that the system malfunction is due to specific file, may not be performed full check SFC. Just enter the command sfc /scanfile=”address to file”, and it will be replaced instantly with the original version if changes were previously made to it or it works with an error.

Via recovery environment

To check the integrity of files using the SFC command through the recovery environment, you will need to perform the following steps:

Click on the Start button in the lower left corner and go to Settings:


diskpart list volume

After executing the second command, a list of available volumes will be displayed. Here you need to pay attention to the disk that is reserved by the system and to the system partition with the operating system. Next, you will need to manipulate them.

Continue typing the commands:

Exit sfc /scannow /offbootdir=C:\ /offwindir=E:\Windows

The last command requires you to specify the drives that were noted above. That is, in the above command example, drive C is the partition with the bootloader, and drive E is the place where the operating system is installed Windows system 10.

Attention: There is a good chance that your drive letters will be different from those given in the example, so the command will vary.

  1. After entering the last of the four commands, an integrity scan of the operating system files will begin.

The advantage of working through the recovery environment is the ability of the SFC tool to replace the files that are needed to boot the graphic Windows interface. Check in in this case will take a little longer than when working through the command line in the operating system interface. At the same time, graphically the user command line in the recovery environment will not notify you about the speed of the process. You can determine that the computer is working properly and the file integrity check has not frozen by the blinking underscore icon.

At the end of the scan, the user will see information that no integrity violations were detected or were successfully resolved. After this, you can move on to the second verification method - using the DISM tool.

How to check file integrity in Windows 10 using DISM

As noted above, after checking using SFC, it is recommended to start analyzing the system with the DISM tool. During the scan, it will examine other directories (and will once again “go through” the files that were scanned by SFC).

Scanning with the DISM tool is slightly different from analyzing the system using SFC. The user has the opportunity to select one of three commands to check the system. Each of them has different level impact.

Dism /Online /Cleanup-Image /CheckHealth

When executing this command, the system checks what has been done diagnostic utilities records on detection of changed or problematic files in the system. The command is executed quickly, but there is no verification, and all data is based on previously recorded information.

Dism /Online /Cleanup-Image /ScanHealth

This team is aimed at analyzing all system components to identify errors and damaged elements in them. In this case, only a check is carried out, and the user is notified of the presence or absence of problematic files. This check can take from several minutes to several hours, depending on the speed work hard disk, its load and the degree of interference with operating system files.

Dism /Online /Cleanup-Image /RestoreHealth

This command, unlike the previous one, not only checks the files, but also immediately replaces them with intact ones. It will also take from several minutes to several hours to complete.

Important: Please note that the last two commands that run the Windows 10 file integrity check may freeze at a certain percentage during execution (usually around 20). Under no circumstances should you reboot the system at this moment, because this situation is typical and interest will continue to accrue over time.

Each of us copies files from time to time. Moving or copying documents to external devices, such as flash drives. Backup multiple directories from one drive to another. Using programs to synchronize files from multiple sources. In most cases, copying files like this will be normal and will not cause any problems. However, at least once, everyone has encountered the problem of corrupted files, when a newly copied file becomes unusable or loses some data. The most unpleasant thing about such an error is that you can find out about it after a long time and precisely at the moment when you need the file.

Many backup and directory synchronization programs include additional functions checking the integrity of the created copies. However, from time to time, file corruption can occur due to glitches or errors in the programs themselves. For example, when you simply copy files using Windows Explorer, then the operating system checks the integrity of files based on CRC (a special number, also called a checksum, calculated based on file data) and this check, in most cases, helps to avoid errors. However, failures in system components or defects hard drive may cause your copy of the file to eventually become corrupted. In addition, in the case of transmission over a network, there is a possibility that some of the bits were transmitted incorrectly, which is why the resulting copy, despite checks, will be damaged.

To avoid similar problems, They were designed special programs file integrity checkers, which perform additional rigorous tests on files to confirm data integrity. Most of these tools use various methods checksum calculations and hash functions to check each file for discrepancies with the original. So if a copy of the file has been changed even in the slightest way, the difference in the final checksums (hash function values) will quickly become apparent.

This technique is widely used on the Internet to allow users to quickly verify that downloaded files are a complete copy of the original ones. If you've ever noticed, sometimes files on pages are accompanied by small lines to verify the file. More often, we're talking about about strings with a check number calculated based on the MD5 or SHA1 hash function. The same technique is used to check originals and copies of files for integrity.

ExactFile is one of free utilities, which makes it easy to check hash functions for large sets files. You can download the program from the developer's page using this link. Using ExactFile is very easy. To check directories, you need to go to the "Create TestFile Applet" tab, then select the desired directory and algorithm for calculating the checksum value (MD5 by default). Then press the “Go” button. The process of calculating checksums will begin. At the end of the process, two files will be created in the directory being checked - “TestFiles.exe” (a file to start checking the sums of the current directory) and “checksums.exf” (a file within which all checksums files in this directory). Now, to check the integrity, you just need to run TestFile.exe. As part of the scan, not only changed files will be displayed, but also missing ones. So if you need to check a copy of the directory, then just copy these files to the directory with the copy and run "TestFile.exe".

One of possible scenarios using this program is sharing with applications for Reserve copy. The algorithm in this case will be quite simple. First you run ExactFile, which creates a TestFile applet to test the files and their data inside the directory. Then you back up your files. And at the end, run TestFile.exe in the backup copy. There is a console line version of ExactFile that can be used in batch files together with other programs, such as with the same backup.

One limitation of using ExactFile with backup applications is the backup method used. So for example, if the backup is compressed to archive file, then you will not be able to run testing of the copy, since for this you need to unpack the archive. Therefore, ExactFile can only be used when creating mirror backups.

Note: In the case of a full backup, you can use the trick of creating a virtual disk based on the archive using the WinMount program. And already on virtual disk run file scan.

ExactFile is especially useful for verifying the integrity of file backups when creating CDs and DVD discs. ExactFile will also be very useful when using synchronization programs or checking the integrity of copied files over the network.

Overall, ExactFile is a great little utility with a lot of potential.


  • How to create an editable PDF file in OpenOffice?

Technical Tips

  • Does not work correctly, you can use the command utility SFC lines to restore damaged or lost system files.

    When you start to notice random errors, problems during system boot or performance issues Windows components, then there is a high probability that this state caused by damaged or lost system files.

    Even though Windows 10 does a great job of protecting the files you need to normal operation computer, some applications, drivers or even Windows updates may cause loss of system stability. Like previous versions of Microsoft systems, Windows 10 includes a System File Checker ( System File Checker, SFC) – compact, but powerful utility command line that can perform a system integrity scan and replace damaged or missing files with the original version.

    IN this manual we will present the steps to use System File Checker (SFC) to automatic recovery damaged system files while the operating system is running. We will also consider how to run the utility in Safe Mode command line and how to manually repair damaged system files that are causing problems.

    Warning: before starting to work with the SFC utility, it is recommended to make a complete backup copy system or create a system restore point. In case something goes wrong, you can return the initial state systems.

    The following command allows you to execute full scan 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, press right click 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 system scans 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 downloaded to RAM during Windows works 10. In this case, you can use the System File Checker during system startup to correct the detected problems.

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

    • 5. Select “Troubleshooting”.
    • 6. Go to “ Extra options”.
    • 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 indicate the SFC where the setup files Windows. 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 in the example to specify the drive letter reserved by the system partition, the /offboodir switch is used. 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 partition (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 repair them manually.

    Open the sfclogs.txt file to determine which files were corrupted. Do a regular search to find file locations, or use search engine for getting additional 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 path damaged file. For example:

    C:\Windows\System32\appraiser.dll

    • 3. Allow full access(administrator access) to the damaged files 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 working version file, and C:\Path-DESTINATION-and-File-Name must 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 were corrected, you can check the integrity of each separate file using sfc team/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 in Windows 10, but also in previous versions 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

    Often, users are forced to believe that the system files of the operating system (OS) are damaged, the reason is characteristic failures when performing basic operations and slow work computer. It happens that loading an external IT product leads to a destructive change in the OS configuration. In these cases, checking the integrity of system files in Windows 10 helps.

    Typically, the OS provides two software products SFC.exe and DISM.exe, and in addition the Repair-WindowsImage command for Windows PowerShell. The first ones check the integrity of the system components and automatically restore their identified defects. The second does this by using DISM.

    Experts are confident that it is more advisable to use them one by one, since the lists of scanned files for these software tools differ from each other.

    In continuation, we will consider several instructions for using the presented software. The described actions are safe, but you must remember that restoring system files is complex in nature and affects even those changes made by the user himself. In particular, installation of external resources and other OS conversions will be canceled.

    Examine the integrity of the system and correct its elements using SFC

    The OS integrity scanning command sfc /scannow is popular among experienced users. It automatically examines and eliminates defects in OS components.

    SFC operates as an administrator, through the command line, which is opened by right-clicking on the Start menu. Next, enter sfc /scannow and press Enter.

    These actions begin a scan of the OS, as a result of which the detected damage is corrected. If there are no errors, the user sees the message “Windows Resource Protection detected no integrity violations.” Another aspect of this study is irreparable damage. Part of the continuation of this article will be devoted to them.

    The sfc /scanfile=”path_to_file” command allows you to check for errors in a specific system component.

    The disadvantage of the software is that it does not eliminate defects in OS elements used during scanning. The problem is solved by running SFC via the command line in the OS recovery environment. This method is quite effective and involves performing several simple operations.

    Integrity testing using SFC in an OS recovery environment

    It does not take much time and does not require special skills. Launching in the OS recovery environment is performed in several ways:

    1. You need to go to “Settings” and select “Update and security”, “Recovery”, “Custom boot options” and “Restart now”. A simpler method: in the lower right part of the OS login interface, click the “on” tab, after which, while holding “Shift”, you need to click “Reboot”.
    2. Another option is to boot from a pre-prepared OS recovery disk.
    3. Another alternative is an electronic medium with an OS distribution. In the installation program, after selecting the language, select “System Restore” in the lower left part.

    When finished, you need to enter “Troubleshooting”, select “Advanced options” and click “Command Prompt” (using the first of the previously presented methods requires entering the system administrator password). The following is applied sequentially:

    • diskpart
    • list volume

    Following the launch specified commands the user sees a list of volumes. It is recommended to remember their designations corresponding to the “System Reserved” drive and the OS partition, since sometimes they differ from those in Explorer.

    sfc /scannow /offbootdir=F:\ /offwindir=C:\Windows (where F is the “System Reserved” drive specified earlier, and C:\Windows is the path to the OS folder).

    The described actions initiate an in-depth investigation of the system's integrity, during which the SFC command fixes all damaged components, without exception. Studying can take a long time. The underscore indicator blinks to indicate that the system is continuing to operate. When finished, the command line closes and the OS reboots in standard mode.

    Scan and repair your system using DISM.exe

    It happens that the SFC team cannot cope with some defects in system components. The IT product DISM.exe allows you to complete the restoration you have started. It scans and maintains the system, fixing even the most problematic components.

    DISM.exe is used even when SFC does not detect OS integrity defects, but there is still reason to suspect that they exist.

    First of all, right-click on the Start menu as an administrator to launch the Command Prompt. Then other commands are launched:

    • dism /Online /Cleanup-Image /CheckHealth. It is used to generate information about the state of the OS and the presence of damage to its components. Does not initiate the study, scans earlier values ​​of recorded parameters.

    • dism /Online /Cleanup-Image /ScanHealth. Explores and verifies the integrity of the system components repository. Takes a long time, barely breaking the 20% mark.

    • dism /Online /Cleanup-Image /RestoreHealth. Examines and automatically repairs the OS. It works slowly, interrupting at times.

    In circumstances where storage recovery system elements is not implemented, install.wim (esd) with Windows 10 ISO is used as a source of patchable components. Another option is used for this:

    dism /Online /Cleanup-Image /RestoreHealth /Source:wim:path_to_wim_file:1 /limitaccess

    In some cases, “.wim is replaced by .esd.”

    While using these commands, all operations performed are saved in a log, which is contained in Windows\Logs\CBS\CBS.log and Windows\Logs\DISM\dism.log. The DISM tool runs in the OS recovery environment in the same way as it does when running SFC.

    This software tool can also be implemented in Windows PowerShell as an administrator, using a set of Repair-WindowsImage commands. For example:

    • Repair-WindowsImage -Online -ScanHealth. Looks for defects in system elements,
    • Repair-WindowsImage -Online -RestoreHealth. Investigates and troubleshoots problems.

    Apparently, restoring the integrity of the OS is a completely feasible task, the solution of which allows you to get rid of various problems with the system. In rare cases, when the described tools do not help, you should use other algorithms found in open access. In particular, you should try to roll back the system to the previous Windows 10 restore point.

    Some users experience that SFC detects defects in system elements immediately after updating from new build OS. Under these conditions, error correction is possible only with a new “clean” installation of the system image. Sometimes damage is detected in certain versions software for video cards. In this case, the file opencl.dll is erroneous. It may not be worth taking any action at all in these circumstances.

    Conclusion

    The described methods for studying the integrity of the OS are simple and effective. The stages of their implementation are understandable to most of the user audience, including those who do not have special programming skills. However, to secure the material, it will be necessary useful videos that are publicly available in worldwide network Internet.