Command to restore system files. Instructions on how to check the integrity of Windows system files

Unstable problem Windows operation 7 often associated with deterioration or removal system files, for example, after reinstalling or installing an infected program. This is not the most difficult problem - there are many ways to recover data standard means OS or manually. We will consider the simplest and most effective options below.

Rollback to last stable state

By default, in all Windows, protection is active for system partitions. It is responsible for creating special checkpoints containing configuration information and system files of the environment before modifying it - installing applications, drivers and updates. Moreover, restore points are created without such a reason by the system at a certain frequency or by the user himself.

If problems began to appear relatively recently, and you remember the approximate date of their appearance, then The best decision- roll back the OS to the moment when no failures were observed during the operation of the OS.

In a production environment this is very easy to do:

All that remains is to reboot, after which the damaged system files will be replaced with previous working versions.

If Windows won't boot

Even if the damage to system data is so serious that the OS cannot boot on its own, you can use restore points:


The corresponding selection utility will launch control point, which needs to be worked with in the manner described earlier.

If pressing F8 does not open the boot options window, you will only be able to get into the recovery environment if you use the boot/installation disk.

Using the standard SFC utility

This application checks and repairs basic OS system files. It can also be run in command line With boot disk, from the window for selecting boot options after pressing F8 and from a running system. The last option is the simplest:


Once the operation is complete, SFC will notify you of the results - the corrupted data should be detected and corrected.

Recovering data manually

Sometimes the methods described above cannot fix the problem. For example, when updating DirectX from distributions shipped with various applications, often get lost DLLs. Therefore, always try to update DirectX from the office. Microsoft website, and if trouble has already happened, then if there is new version all DLLs will be updated automatically after installing a fresh component package from the website http://www.microsoft.com/ru-ru/download/confirmation.aspx?id=35.

If there is no new version on the specified page, then any DLL from another source can be transferred to your system yourself. Libraries are stored in the following directories:

  • for Windows 7×32 - in the folder C:\Windows\System32;
  • for Windows 7x64 - in the C:\Windows\SysWOW64 directory.

If, when you launch an application, a window appears informing you that a DLL is missing, and the installer from the Microsoft website reports its presence on your system latest version libraries and does not update components, you can simply use search engine. Find DLLs on the Internet and move them to the specified folders.

Not only DLLs, but also any damaged system files can be extracted from the Windows 7 installation distribution. To do this, you just need to know which files are damaged. Often the OS itself informs the user about the absence of a DLL or about an application error, for example, Explorer.exe. You can get the information yourself.

Let's find out what system information is faulty

To do this, you will again need the command line; we have already described how to open it. Write the following command here:

indstr /N:"" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt", where N is the drive letter.

Press Enter, after which sfcdetails.txt will be created on the desktop, which you need to open and carefully review. Its content will be similar to the image below.

Here we see that the Accessibility.dll library is damaged. It is this that you will need to find on the Internet or extract it yourself from the existing Windows 7 distribution to carry out the recovery.

Extracting OS components from the distribution

In addition to the installation disk, you will need a small free application 7-zip. With its help, we will work with the install.wim image located in the sources directory. The order is as follows:


All that remains is to copy them to the desired folder or to a flash drive. You can replace damaged data with them using installation/bootable media or LiveCD.

Whenever something goes wrong with your computer or laptop, there are a number of troubleshooting tools you can run to try and fix the problem. Windows 10/8/7 has several built-in commands that you can use to check and repair corrupted system files that cause problems when modified over time. One way to troubleshoot Windows problems is to scan your system and repair system files. It can help in all types of problems such as slow system, blue screen of death, sudden power failures and system crashes.

Let's take a look at how to run System File Checker in Windows using CMD command line And PowerShell, such teams as sfc /scannow and tools DISM. I would like to note that for the Anniversary update Update Windows 10, it will be better to use methods with PowerShell.

Check and Restore system files via CMD

System File Checker scans your computer for any damage or changes to system files that are otherwise could interfere with the normal operation of your PC. From there it replaces the file correct version to ensure smooth operation. Using the command line, you can try to scan and restore system files of later operating systems like Windows 10/8/7/Vista. Let's look at two teams sfc /scannow and DISM using CMD.

1.

  • Run Command Prompt (CMD) as an administrator. Click "search" and simply write "cmd" or "command line", then right-click on it and run as administrator.
  • Specify the command sfc /scannow and wait for the process to complete.


Note: After scanning your system, one of three results will be returned:

  • There will be no system file errors.
  • There will be system file errors and Windows will repair them automatically.
  • Windows has detected errors but cannot repair some of them.

If option 3 shows you that an error has been detected and the system cannot recover, then repeat the procedure. I advise you to disable encryption and if they are available at the time of checking. Nothing succeeded? Let's move lower.


2. (DISM)

If the above doesn't work in safe mode, there is one last method check for corruption in system files and fix them. We use the Deployment Image and Service Management (DISM) tool. The team works with Windows 8/8.1/10 systems. Open it back and use the following command:

The process may take a long time and the percentage scale may freeze. When finished, restart your computer and start it back sfc /scannow to make sure there are no errors or the error has disappeared.


Check and Restore system files viaPowerShell

We will use Windows PowerShell to show how to use the Maintenance and Management Service DISM to scan and fix damaged system files in Windows 10. This method will be more effective for updating Anniversary windows 10 than the command line.

1. Using the System File Checker (SFC) tool

  • Run PowerShell on behalf of the administrator. Click "search" and type windows powershell, then right-click and select as admin.

  • Set in the window PowerShell command sfc /scannow. If the scan finds any problems, Windows will try to fix them. If Windows can't fix them, it will warn you that further investigation and action is needed. Move below if errors are found.


2. Using the Deployment Image and Service Management tool (DISM)

The DISM scan detects corrupted system files and Windows will try to fix them and give you a progress report at the end. If Windows is unable to find the files needed to repair damaged system files, you will also be given information on what to do next, with a link to the Microsoft website and troubleshooting options. Enter the below command into the PowerShell window.

DISM /ONLINE /CLEANUP-IMAGE /RESTOREHEALTH

If DISM fixed everything or did not reveal any errors, then restart your laptop or computer and run it back to check sfc /scannow.


This article shows the steps by which you can recover damaged Windows system files using the SFC utility

If the operating system is unstable and various errors are noticed in its operation, then to troubleshoot problems you can use the SFC command line utility to restore the integrity of damaged system files.

SFC (System File Checker) - system Windows tool to check and restore system integrity, which scans and checks all protected Windows system files for errors and replaces damaged or missing files with a copy Windows files, located in the WinSxS directory.


How to check and repair damaged system files using the SFC utility

To scan and repair damaged system files, run the following command as an administrator:

Depending on the scan results, you will see one of the following messages:

Windows Resource Protection did not detect any integrity violations. This means that no damaged or missing files were found on the system.

Windows Resource Protection cannot perform the requested operation. This message means that an error occurred during scanning. If you encounter this issue, try running the command sfc /scannow

Windows Resource Protection detected damaged files and successfully restored them. See CBS.Log WinDir%\Logs\CBS\CBS.log for information. This message appears when the SFC utility was able to correct the problem. You can view detailed information about the files that were recovered in the log file stored in C:\Windows\Logs\CBS\CBS.log

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, Windows was unable to fix some files. Again, you can see the list of files in the log file stored in C:\Windows\Logs\CBS\CBS.log. In this case, the user will have to manually replace the missing or corrupted files.

You can also check and restore damaged system files using open as administrator.

How to check and repair damaged system files if the system does not boot

If the operating system does not boot, then you can also use the tool to restore the integrity of damaged system files, since the SFC utility supports offline scanning and recovery of damaged system files.

To do this you will need a (disk) with . Boot from installation media and on the screen for selecting regional settings, launch the command line, to do this, press the combination Shift keys+ F10

Now you need to find out the letter of the partition on which the Windows operating system that needs to be checked is installed. This must be done because the drive partition letters in the boot environment are often different from those used in the running system.

There are several ways to do this, such as diskpart, wmic or the dir command, but we will use another method.

At the command prompt, run the following command:

In the Notepad window that opens, select from its main menu File - Open...

In the Explorer window, you will see the available sections and the letters assigned to them. IN in this example The partition on which the operating system is installed has the letter C. The Explorer and Notepad windows can now be closed.

Knowing the letter of the partition on which the operating system is installed, run the following command at the command line:

sfc /scannow /OFFBOOTDIR=C :\ /OFFWINDIR=C :\Windows

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 during the operation of your computer or its incorrect behavior, for example, the periodic appearance of blue screen death, then, first of all, you need to check the disk for errors. If this check did not find 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 done 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 Windows Repair is used to scan your computer for damaged system files and restore them if problems are found.


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 tools operating system.

Method 2: Glary Utilities

The next comprehensive program for optimizing computer operation, with which you can check the integrity of system files, is Glary Utilities. Usage 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 work "SFC" presented when considering the following method.

Method 3: "Command Line"

Activate "SFC" to scan for file corruption Windows systems, 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 tool before starting installation disk operating system. 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 same OS in which you are working in this moment. 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.

Most common cause 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 different 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 check 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 it easier and more intuitive to launch the built-in scanning tool. 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" data software products, since this is still more convenient than acting traditionally through "Command line".

Not many people know that Windows system files can be checked using a special sfc /scannow commands. Let's try to figure out in what cases using this command may be useful.

If you suspect that System files are damaged, changed or missing in Winodws 7 and Windows 8 You can check system files using the built-in operating system tool.

So, in order to check the integrity of operating system files you need to run the scanning utility. For this.

1. Launch Command Prompt. Press the Win+R key combination and in the window that opens, type cmd. A command prompt window will open. If you have Windows 8.1, then press the Win + X keys and launch “Command Prompt (Admin)” from the menu that appears.

2. At the command prompt, enter sfc/scannow. The verification utility will launch Windows systems. This utility will check Windows files and, if possible, fix errors.

There is also a very important note! If during the scanning process the system detects damaged files type on the command line: dism /online /cleanup-image /restorehealth and wait until the missing files are downloaded and installed!

Extended use of the SFC /SCANNOW utility

Full list of parameters, with which you can run this command looks like this:

SFC

What is it for?

You can only run System File Checker without fixing them using sfc /verifyonly
-It is possible to check and fix only one system file by running the command sfc /scanfile=path_to_file (or verifyfile if correction is not required).
-To check system files not in current Windows (and, for example, on another hard drive) can be used sfc /scannow /offwindir=path_to_windows_folder

These features will be useful, for example, if you know which specific file the problem lies in, or you need to check the system on another disk.

When using the System File Checker utility, you may encounter some problems and errors.

For example, if you run sfc /scannow and see a message that "Windows Resource Protection is unable to start the repair service", check that the Windows Modules Installer service is enabled and the startup type is set to Manual.

If you have modified files on your system, for example, you replaced icons in Explorer or something else, then running an automatic correction scan will return the files to their original form. The fix can also return a modified Windows build to its original form.

It may turn out that sfc /scannow will not fix errors in system files, in this case you can enter on the command line:

findstr /c:"" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfc.txt"
Creating a system file check log

This command will create a text file sfc.txt on the desktop with a list of files that could not be repaired.

If you require, you can copy the required files from another computer with the same Windows version or from the OS distribution. (which is more preferable).

Internet