Finding and fixing problems command line 10. How to check the integrity of Windows system files and why do it at all. How errors are corrected

Nobody likes it when the usual customized Windows 10 starts to crash and freeze. Let's figure out what reasons this may be associated with, and learn how to identify and correct the problems that have arisen.

Checking Windows 10 for errors

There are two types of errors in the operation of computer devices:

  • hardware - physical damage to the device’s hardware is to blame for their appearance;
  • software - associated exclusively with the software component.

Let's figure out how to identify these failures and correct them using various means.

If hardware errors can be “cured” only by replacing or repairing the damaged part, then software failures can be corrected using special built-in or third-party utilities.

Diagnostics Windows 10 using SFC

SFC.exe - system utility, built into Windows 10, which is responsible for checking the integrity and performance of system files. If any of them are damaged, the program automatically repairs them. SFC is not omnipotent: it is recommended to use it in conjunction with DISM, which will be discussed later. However, using this utility is practically the first thing to do in case of system failures.

For some (sometimes quite a long) time, the utility will check system files for integrity. After completion of the work, it will give the user the result.

SFC cannot repair some of the system files while Windows is running, because this moment they are used by the system. If the SFC check shows that there are problems, but it cannot solve them, the utility must be launched again, but not from the system, but from the Windows recovery tool.

You can open the Windows Recovery Tool in the following ways:

  • go to “Start” - “Settings” - “Update and Security” - “Recovery” - “ Special options downloads" - "Reboot now";

    “Update and Security” item in Windows settings allows you to access the special boot options menu

  • select the "System Restore" option when booting from installation media(or from a recovery disk);

    Click on the "System Restore" button when booting from installation media

  • instead of the start button, click on a special button that allows you to enter recovery mode. It is available on some laptops, for example Lenovo. As a rule, such a button is located either next to the system start button or next to the charger connector.

    Some laptops have a button that opens the recovery menu

From the recovery menu, do the following:


This time, the SFC utility will be able to repair all files, even those that are usually inaccessible to it.

Video: how to run the SFC utility

Scan and repair Windows 10 using DISM

DISM is another utility for recovering damaged files. Its scope of application is much wider than that of SFC. You can even use it to make system backups. DISM and SFC are responsible for different groups of system files, and they sharing more effective than using alone.

Diagnostics and repair of system files using DISM are also carried out through the “Command Line”. How to enter it is described above. There are several options for using the command:

  • dism /Online /Cleanup-Image /CheckHealth - no check is performed, the utility displays the latest saved data on the status of the files;

    The command dism /Online /Cleanup-Image /CheckHealth shows what results the disk check gave last time

  • dism /Online /Cleanup-Image /ScanHealth - checks the integrity of files without “fixing” the problems found;

    The command dism /Online /Cleanup-Image /ScanHealth starts checking all system files through DISM without “repairing”

  • dism /Online /Cleanup-Image /RestoreHealth - starts checking the integrity of files and then restoring damaged files.

    Checking system files in DISM and then repairing damage is started with the command dism /Online /Cleanup-Image /RestoreHealth

Scanning and restoring files takes quite a long time. Also a completely normal feature of the DISM utility is the status bar freezing at 20%.

Video: how to check the integrity of Windows 10 using SFC and DISM

Checking the hard drive for failures

In addition to physical damage to the hard drive, there are also errors that can be “cured” using the built-in diagnostic tools of Windows 10. To fix more serious problems (for example, bad sectors) can be used third party utilities, but after a while the disk will still have to be changed.

Using the Command Line

Using the Command Line, you can run the built-in Check Disk utility, which checks the disk for errors and, if possible, corrects them. In a Windows environment, this program will not be able to check the system drive (drive C): it will prompt you to reboot and will check during the reboot before the OS starts.

If the chkdsk utility receives a system disk as input, it prompts you to reboot the system to check it

The utility is launched in the “Command Line” (how to enter there is described above) using the chkdsk command<имя диска с двоеточием>with the given parameters:

  • /f - auto-correction of found errors;
  • /r - check for bad sectors and attempt to restore damaged information;
  • /offlinescanandfix - offline scan, in which the program first “disconnects” the disk from processes in the system, and then checks it. Applies if the disk is in use and a “simple” run of Check Disk cannot fix the errors;
  • /? - help on the command.

The command with the /r option can take up to several hours to complete.

As a result, chkdsk will display the disk data obtained during the scan

Video: how to check your hard drive for failures using chkdsk

Using StorDiag

The storage diagnostic utility is present only in Windows 10 and is not used in other versions of the system. Just like Check Disk, it is launched via the “Command Line” using the command stordiag.exe -collectEtw -checkfsconsistency -out<путь к папке, куда сохранится отчёт>.

StorDiag does not correct the errors found, but only diagnoses them and writes the received data to a report file.

However, its diagnostic scope is wider than that of Check Disk, and if you are an advanced user, you can use this program to more accurately determine the cause of problems with your device.

Checking the disk using the StorDiag storage diagnostic utility will allow you to diagnose problems and write the resulting data to a separate file

Using PowerShell Windows PowerShell

is a “Command Line” shell used in Windows as another management tool. It is distinguished from a regular console by a wider range of applications, the ability to use scripts and other improvements.

PowerShell is located at Start - All Programs - Windows PowerShell. The console can also be found by simply typing its name in the Start menu search.

  • To check the disk, type in the PowerShell “Command Prompt” running as administrator (right-click on the PowerShell icon - “Run as administrator”) one of the following commands:<буква диска без двоеточия>- normal check with recovery;
  • To check the disk, type in the PowerShell “Command Prompt” running as administrator (right-click on the PowerShell icon - “Run as administrator”) one of the following commands:<буква диска без двоеточия>-OfflineScanAndFix - offline check (what it is was described above).

The specified commands entered in PowerShell will launch the disk diagnostic and treatment tool

Using Explorer and Control Panel

Diagnose HDD To check for errors, you can run the diagnostic utility through Explorer. To do this, follow the path: “My Computer” - right mouse button on the disk that needs checking - “Properties” - “Service” - “Check for errors”. The check performed is similar to Check Disk.

Diagnostics and error correction can be started from the disk properties window

In addition, through the “Control Panel” you can activate system maintenance, which includes checking hard drives. It is located along the path “Start” - “Control Panel” - “Security and Service Center” - “Maintenance”. In the maintenance window, you can view the results of the previous scan or start it again using the “Start maintenance” button.

To start disk maintenance, you need to click on the corresponding button

Video: how to check your hard drive for errors using the built-in diagnostic utility

Windows Registry Diagnostics

The registry is another Windows component that often gets damaged, leading to crashes, glitches and freezes. To prevent this from happening, you need to periodically clean it, removing outdated branches, consequences of failures and erroneous entries.

Manually cleaning the registry is very labor-intensive and time-consuming. In addition, it is easy to make a mistake when carrying out this procedure, which can lead to negative consequences (including system crash).


Therefore, we will touch on the topic of manual cleaning in passing. If you don’t want to waste time on manual cleaning, use one of special programs , which will automatically clean the registry of unnecessary and erroneous entries. The most popular of them is CCleaner - free utility


, which not only corrects registry errors, but also cleans the computer of garbage and accumulated temporary files.

Let's figure out how to work with it.

You can download CCleaner from the official website of the developer.

Typically, Windows 10 Diagnostic Mode (formerly called Safe Mode) starts automatically when there is an abnormal shutdown operating system, as well as during various Windows failures.

Safe Mode - diagnostic mode of the Windows 10 operating system

I would like to immediately note that as a specialist Windows installer, this mode in 10 has undergone significant changes. There have never been such extensive diagnostics and recovery tools in Windows operating systems.

That is why, we will consider in detail how to work in diagnostic safe mode in order to be able to restore Windows 10. Preparation for such tasks will always be useful for experienced users and system administrators.

2 Ways to Start Windows 10 Diagnostics Safe Mode

How to enter safe mode in Windows 10? In previous Windows versions Safe mode could be started using the F8 key. Now, in order to start diagnostic mode in Windows 10 manually, you need to do the following:

In the window that opens, go to the “Recovery” tab, then “Special boot options” and click the “Restart now” button;

Windows 10 is forced to reboot;


Windows 10 diagnostic mode in action

After we forced a computer reboot in a special boot option Windows system 10 does not load, but a blue “Select Action” window appears, where we need to decide and choose from the options:

  • “Continue” - in this case we exit the diagnostic mode, the Windows 10 system loads;
  • “Troubleshooting” - by selecting this tab, we will be able to carry out a complete diagnosis of the system;
  • “Turn off computer” - accordingly, in this case the computer turns off.

Open the 2nd tab, the “Diagnostics” window opens in front of us. Here we can also select tasks from 2 options: “Return the computer to its original state”, “Advanced options”. Let's consider all cases of developments, first select “Return the computer to its original state”;

Everything is clear here without comments, so let’s start studying the “Advanced parameters” tab, to select which we press the arrow button in the upper left corner.

In the “Advanced Settings” tab there are a lot of useful utilities, using which you can revive the Windows 10 operating system. Let’s take a closer look at this entire gentleman’s set of system diagnostics!

  • System Restore - This tab is used to restore the system to a specific point in time. To use this feature, a restore point must be created. Recovery points are created automatically (if this option is enabled on the disk) at certain moments (for example, after installing a program or Windows updates), such points can also be created manually. A very useful option! I advise you to create points manually from time to time.

Now let’s open the “System Restore” tab and see what’s there. So we choose account, under which we want to open the recovery process, in the next window we enter the password and click the “Continue” button, the “Restore system files and settings” window opens. And we see that on system disk no restore points. By default, “System Restore” is disabled; it must be enabled in the “System Protection” tab, which I will discuss in detail in the review article “System Restore.”


  • Restoring a system image - when choosing this option, you also need to select the account on behalf of which the recovery will be performed, then Windows looks for the system image on the disk and displays messages asking you to specify the location of the backup copy. We will consider this option in the near future. Follow the news on the website and in the VK group!

  • Startup Repair - When you select this option, the system tries to fix problems that prevent Windows 10 from loading;

  • Command Prompt - Selecting this tab opens a command line Windows environment 10, from where you can perform many manipulations with the system (for example, run a check disk Chkdsk, open the utility for working with hard Diskpart disks and much more);


  • Boot options - by selecting this mode, you can boot Windows 10 in safe mode, which enables debugging mode, keeps a boot log, and disables automatic system reboot when the system crashes. Launch Windows 10 Safe Mode with the following useful options very simple. You just need to select one of the options using the F4-F6 keys. What happens next Windows boot 10 in safe mode;

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 perform a check using SFC either in the familiar Windows 10 interface via the command line or 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 graphics may not work correctly. Windows interface, and the system will not be able to fix them, since they are active. In such cases, it is necessary to perform an SFC check through a recovery environment that does not require booting GUI and is able to work with these files, as well as change them if necessary.

Please note that if you suspect that the system failure is related to a specific file, you do not need to perform a full SFC check. 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 example command, drive C is the partition with the bootloader, and drive E is the place where the Windows 10 operating system is installed.

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 Windows GUI. The check 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 a different level of impact.

Dism /Online /Cleanup-Image /CheckHealth

When executing this command, the system checks the records made by diagnostic utilities to detect 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.

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, system boot problems, or performance issues Windows components, then there is a high probability that this condition is caused by damaged 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 a System File Checker (System File Checker, SFC) is 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 manual we will present the steps to use System File Checker (SFC) to automatic recovery damaged files system 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 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, 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 a keyboard Windows combination+ I to open the Settings app.
  • 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 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, the /offboodir switch is used 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 normal.

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. Do a regular search to find file locations, or use search engine for 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 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 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 were corrected, you can check the integrity of each separate 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 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.

Like any other OS, Windows 10 begins to slow down over time and the user increasingly begins to notice errors in operation. In this case, it is necessary to check the system for integrity and the presence of errors that could seriously affect operation.

Of course, there are many programs with which you can check the operation of the system and optimize it in just a few clicks. This is quite convenient, but you should not neglect the built-in tools of the operating system itself, since only they guarantee that Windows 10 will not suffer even more damage in the process of fixing errors and optimizing the system.

Method 1: Glary Utilities

Glarу Utilities is a whole software package, which includes modules for quality optimization and recovery of damaged system files. A convenient Russian-language interface makes this program an indispensable assistant user. It is worth noting that Glarу Utilities is a paid solution, but anyone can try the trial version of the product.


Method 2: System File Checker (SFC)

"SFC" or System File Checker - utility program, developed by Microsoft to detect damaged system files and then restore them. This is a reliable and proven way to get the OS working. Let's look at how this tool works.

Method 3: System File Checker (DISM)

Unlike the previous tool, the utility "DISM" or Deployment Image & Servicing Management allows you to detect and correct the most complex problems that SFC cannot fix. This utility removes, installs, lists and configures packages and components of the OS, restoring its functionality. In other words, this is a more complex software package, the use of which takes place in cases where the SFC tool has not detected problems with file integrity, and the user is sure of the opposite. Procedure for working with "DISM" as follows.


Checking Windows 10 for errors and further recovering files, no matter how difficult it may seem at first glance, is a trivial task that every user can solve. Therefore, check your system regularly and it will serve you for a long time.