14.07.2020

System check cmd. Checking Windows system files for integrity. Rollback to the last stable state


Read the article on how to check Windows system files. Why check the integrity, how to restore in Windows 10, 8, 7 and XP.

Users are advised to periodically check system files for integrity. Almost no one does this, which leads to the need to reinstall the operating system. It is necessary to carry out a check in cases where system folders have been exposed to malware or malfunctioning due to improper shutdown of the PC. Checking Windows system files is carried out by different tools. In most cases, you don't even have to install additional programs - you can handle by standard means... The utilities will be needed to restore the system if you have no backups of yours left.

Checking the integrity of Windows system files using SFC

You can run System File Checker on any version of Windows starting from XP. You just need to go to the command line. In most Windows versions, this can be done using the menu. "Start". In the eighth version of the OS, to call the command line on behalf of the administrator, you need to call the context menu using the Win + X keyboard shortcut, and then select the desired item from the list.

  1. Enter the sfc / scannow command.
  2. Hit Enter.
  3. Wait until the end of the check and evaluate the result.

The team will try to fix minor bugs on its own. This is the easiest way to work with system files. The advantage of the SFC is that it has additional features and easy to use.

Please note that in custom Windows assemblies this utility will always find errors. This is because collectors often change appearance systems. Therefore, before rebuilding working system consider whether it is worth doing. It is recommended that you rollback to a checkpoint or replace files only if you notice critical errors, virus attack or other problems.

Additional SFC features

The built-in SFC utility can be run with several parameters. In addition to checking Windows, you can:

  1. If you do not want to fix errors in the system files, then enter the sfc / verifyonly command.
  2. If you know exactly which system file is damaged by the virus, then you can tell which one: sfc / scanfile = path_to_file. If you replace the word scanfile with verifyonly, only the specific file will be verified, the system will not restore it.
  3. If you want to check files not in the current folder, but on remote computer or another hard disk, then you need to enter the command in the following form: sfc / scannow / offwindir = path_to_windows_folder.

Most often, these opportunities are used system administrators. For ordinary users a basic command is enough.

Possible problems

If you were unable to recover files standard ways, you can do this manually using a system disk image. Edit virtual disk with system files, you can use the UltraISO utility or similar programs. The system is restored according to the algorithm:

  1. Go to the folder with the image files. By default LiveDisk uses / cdrom.
  2. From there copy required files to the clipboard and then move them to win.

This method is good because the utility removes all restrictions. file system that are superimposed by the Windows system. You can work with system components, move them, replace them with new ones.

Manual recovery is well suited for advanced users. For those who are uncertain about using the computer, it is best to use the utilities that work in automatic mode... There are also programs that can make it easier to work with the built-in services.

Microsoft DaRT

This is not just a utility, but boot disk able to cope with the task of restoring system files. Configure boot from disk before starting your PC and insert a boot disk. You can download Microsoft DaRT, and then use Nero software to burn it to the media. System files are checked and restored according to the instructions:

  1. Select the utility from the boot disk menu to check your system version.
  2. From the actions presented in the next menu, stop at the item "Diagnostics".
  3. Then you need to select the item Diagnostics and Recovery Toolset.
  4. After preconfiguration, all that remains is to select the target operating system. Most users have only one.
  5. The menu will offer you several options for working with hard disk and the system, you need to select "System File Checker".
  6. Then follow the prompts of the verification wizard. Select automatic operating mode,

The utility will do the rest for you. After its work, all that remains is to restart the PC. The advantage of this utility is that it can be used even with a non-working Windows operating system.

Windows Repair

This utility starts from the production environment. You need to work according to the instructions:

  1. Go to the Pre-Repair Steps section.
  2. Select the Step 4 (Optional) tab.
  3. Click the Check button.

This utility is simple - you don't need to do any additional steps. It is suitable for inexperienced users who do not have command line skills. It runs the standard SFC utility from its shell.

Glary utilities

Glary Utilities works similarly to the previous one - it is as simple and understandable as possible. It doesn't have a lot of tabs. The advantage of this program is that it is Russified. All commands are clear to users. Through it, you can not only check, but also restore the system.

Follow the instructions:

  1. Go to the "Modules" tab.
  2. In the left side menu, select the "Service" item.
  3. On the right side of the window, click System File Restore.

The operation of this simple utility is also based on interaction with the console SFC. If the files cannot be restored, you will have to act with more complex means - through the boot disk or copy damaged files manually.


Windows? Checking the integrity of the Windows 10/8/7 / XP OS is needed if you suspect that some of the system partitions have changed or underwent defects due to the influence of a malicious program.

There are several tools available to check the integrity of Windows 10 files. The most common is SFC.exe, often used by DISM.exe. You can also use the Repair-WindowsImage function in PowerShell. We recommend using several methods, but one by one. This is necessary because each of the options will check the integrity of different files. If you needed to perform such a procedure, but do not know how to check the integrity of Windows 10 system files correctly, to correct them, resume work, carefully read the recommendations below, follow the sequential steps, then you can check, restore the integrity of Windows 10 system files and others. versions.

Check the status of system files using Windows tools

Scanning with SCF

Many users use the sfc / scannow command to scan the operating system before restoring lost, damaged files for the purpose of their correct functioning, resuming uninterrupted operation, troubleshooting by restoring damaged components, it examines and fixes Windows 10 system partitions offline.

  • To activate this command, first open CMD, start with administrator rights. You can activate the utility using the mouse by right-clicking on the main menu "Start", then selecting "Command line" from the list. In the dialog box type sfc / scannow, press Enter.
  • A check will begin, defects will be revealed, then they will begin to be corrected without your intervention, assistance automatically, by the system itself. If no errors were found, you will be informed that no problems were detected by OS Resource Protection.
  • If you decide to check any one determined from the system files, then in command line specify scf / scanfile = "path to file".
  • It should be noted that SCF is not able to fix errors of those partitions that are running at the time of scanning, so it is best to use SFC exclusively when starting Windows 10 Environment Recovery.

Running SFC Using Recovery Environment

To properly activate the SCF, follow the steps below the described algorithm in sequence.

After completing the above steps, a list of volumes will appear, you need to remember or write down those letters that correspond to the system partition and the "System Reserved" disk.

sfc / / scannow / offbootdir = bootloader partition letter: \ / offwindir = E: \ Windows (or your Windows 10 directory path).

As a result, a scan should start to check the integrity of the system files, recovery will be available for all of them. Please note that the check will take quite a significant amount of time; you do not need to turn off or restart your computer during the entire procedure. The last step will only need to be performed when the scan completes and you close the command line.

Scanning with DISM.exe

The specified utility is used to mount images, makes it possible to identify and fix problems that arise with OS partitions as a result of their damage, and perform recovery. It is perfect for those sections that the SFC couldn't handle. It can also be used if the SFC was unable to detect any scan problems. Therefore, do not limit yourself to only one type of scanning and treatment of damaged areas, be sure to carry out this operation when working with system components.

The command line is also used to launch DISM.exe. Activate it as administrator and then follow the steps:

  • dism / Online / Cleanup-Image / CheckHealth - this function provides information about the presence of defects, damage to different Windows components 10. Deep verification, however, is not performed, only previously found data is used.
  • dism / Online / Cleanup-Image / ScanHealth - Scan for possible damage to component store. This check often takes a lot of time, periodically hanging in the implementation process (usually by 20%).
  • dism / Online / Cleanup-Image / RestoreHealth - a thorough examination and reconstruction of system files offline, recovery, which also takes a long time.

All logs of actions when executing the above commands are written to the path Windows \ Logs \ CBS \ CBS.log, Windows \ Logs \ DISM \ dism.log

Like the previous utility, DISM is also launched through the mode Windows recovery 10.

Checking the integrity of system files in Windows 7/8 is identical to the same operation in the 10th. It is carried out in the same way - via the command line via SFC and the corresponding command. All actions are performed in the same sequence as described earlier. A similar algorithm is used to check the integrity of system files in Windows XP. The command line interpreter starts like this:

  • go to the "Start" menu;
  • click on the "Run" option;
  • in the dialog box, type the command "cmd", then on the keyboard Enter.

As a result, the usual command line will open, you can perform all the actions to check the OS files for defects.

All these operations will help to restore damaged, damaged partitions of any Windows-class operating system, which will solve the problem of interference of malicious programs in the computer, return performance to its work, and avoid extreme measures, such as full system recovery in case of malfunctions. You do not need to completely reinstall the OS, it is enough to restore the damaged components. Identify them using special commands and utilities, and your computer will continue its work.

As a result of some failures of Windows 7 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, each user of the "Seven" should be able to independently check and reanimate system files in a computer with Windows 7.

File analysis method

The main tool for checking and analyzing their integrity in the "Seven" is the built-in OS application "SFC.exe", which can also restore defective files. Regular use of the "sfc / scannow" command to perform the check will keep Windows 7 running smoothly. It is recommended to apply it at least once every six months.

Analysis procedure

Windows 7's built-in validator runs as follows:

Note: you cannot close the console until the procedure is complete. At the end, the results of the executed program work will appear.

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

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

After that, a "txt" -file with a list of all files that the program is not able to reanimate itself will appear on the Windows 7 desktop. 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 the distribution of the "Seven" modification that works on the user's PC.

Algorithm for recovering a damaged file in manual mode

Now, knowing the exact name and location of the problem file, which the application could not fix in automatic mode, you need to replace it. To this end, it is necessary to carry out the following sequential steps:


What if the SFC.exe application doesn't work at all?

It happens that the utility cannot even start. In such a situation, the health of the following applications should be analyzed:

  1. RPC locator;
  2. Remote procedure call;
  3. Starting DCOM server processes.

If these programs function normally, "SFC.exe" will start.

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

Additional methods of analysis via "SFC"

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

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

Conclusion

Some users, at their discretion, modify files, change icons in the explorer, and the like. After the application has been working to analyze and correct the integrity of the OS, all the corrections made will be canceled and revert to the default form. Therefore, such computer owners will need to perform all their operations to modify the system after the utility has been executed.

The problem is unstable Windows work 7 is often associated with damage or deletion of 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 using standard OS tools or manually. We will consider the simplest and most effective options further.

Rollback to the last stable state

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

If problems began to appear relatively recently, and you remember the approximate date of their appearance, then the best solution is to roll back the OS to the point where no failures were observed during the operation of the OS.

It is very easy to do this in a production environment:

All that remains is to reboot, after which the damaged system files will be replaced with the 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, there is an opportunity to use restore points:


The corresponding utility for selecting a checkpoint will start, and you need to work with it in the manner described earlier.

If the boot options window does not open when you press F8, then you can get into the recovery environment only when using the boot / installation disk.

Using the standard SFC utility

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


Upon completion of the operation, the SFC will notify you of the results - the corrupted data must be detected and repaired.

Recovering data manually

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

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 C: \ Windows \ System32 folder;
  • for Windows 7 × 64 - in the C: \ Windows \ SysWOW64 directory.

If, when launching an application, a window appears informing about the absence of any DLL, and the installer from the Microsoft website informs about the presence in your system latest version libraries and does not update components, you can simply use search engine... Search the Internet for DLLs and move them to the specified folders.

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

Find out which system information is faulty

To do this, you will need the command line again, 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 something like the image below.

Here we see that the damaged library is Accessibility.dll. It will be necessary to find it on the Web or independently extract it from the existing Windows 7 distribution kit for recovery.

Extracting OS components from the distribution

In addition to the installation disk, you need a small free app 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 USB flash drive. You can replace corrupted data with them using installation / bootable media or LiveCD.

The Windows operating system is in many ways similar to a living organism, from which it follows that sometimes even the smallest damage or deletion of one or more of its files can lead to certain problems. The cause of damage can be the actions of viruses, malfunctions software, sudden power outages, errors while editing system libraries, and so on.

As a result, the user may face various errors when launching programs or the inability to install them, problems with system settings, and even blue screens of death. Therefore, when diagnosing problems, the first step is usually to check the integrity of the Windows 7/10 system files. At the moment, there are two main methods of checking and restoring system files - using standard utilities SFC and DISM launched via the command line or the PowerShell console.

The second tool is more powerful and is usually used when the SFC is unable to cope with the task or its launch fails. There are also designed for these purposes third party programs, but for the most part they duplicate the functionality of SFC and DISM, providing more convenient access to them through the use of a graphical interface. In critical cases, when neither SFC nor DISM helps, restore the system or its individual components using a previously created backup copy is used.

Using SFC

SFC utility or else System Files Checker is present in all Windows versions since 2000 and is intended for checking the status and restoring system files. The SFC can take multiple arguments, but in this case we are only interested in one. Checking and restoring system files Windows 7/10 with its help is as follows. Run Command Prompt or PowerShell Console as administrator and run the following command:

sfc / scannow

The verification procedure will take some time. If, upon completion, errors are found, the utility will offer to restore the damaged files during the restart of the computer. If SFC writes that it cannot recover files, make sure that you have disabled the EFS and Bitlocker encryption functions, boot into safe mode, and then repeat the scanning procedure.

To maximize access to the file system, you can perform the repair of damaged Windows system files in a bootable environment. There are several ways to get into the recovery environment, but we offer the most universal one. Boot your computer from the Windows installation disc, and when the installation wizard appears on the screen, click Shift + F10... Since the drive letters are different in the boot environment, you need to determine the letter of the system partition. We execute the following commands:

diskpart
list volume

On MBR disks, the system partition will most likely have the letter D, and the "System Reserved" partition will have the letter C. Knowing the letter labels of the volumes, use the exit command to close Diskpart and perform a check:

sfc / scannow / offbootdir = C: / / offwindir = D: /

After the scan completes, Windows will restart normally.

DISM utility

How to check the integrity of Windows 7/10 system files if the method described above does not help or when you run commands, you get different errors? In this case, you can try to resort to a more powerful tool - the utility DISM... We launch the command line with administrator rights and execute the following command:

dism.exe / online / cleanup-image / scanhealth

If the utility reports that the component store needs to be restored, restore it with the following command:

dism.exe / online / cleanup-image / restorehealth

If you receive errors while executing the commands, try repairing the Component Store using an elevated PowerShell running by running Repair-WindowsImage -Online -RestoreHealth while the computer is connected to the Internet.

After the performed procedures, you can check sfc / scannow and see if errors will be repeated. If so, check if the Windows Modules Installer service is enabled, but in general, it is advisable to do this in advance.

Recovering damaged files in manual mode

This method it is used when it is impossible to recover damaged SFC files, but to use it you will need exactly the same operating system installed on another computer, or virtual machine or a backup. To determine which files you need to recover, run the command at the command line:

findstr / c: ""% windir% / logs / cbs / cbs.log> "D: /sfc.log"

Information about damaged files will be saved to a log file, in our case it is sfc.log to disk D. The contents of the file can be quite large, look for blocks with the key phrase "Cannot repair" (could not be restored) with the corresponding date and time of scanning.

The attached screenshot shows that SFC was unable to repair the Asseccbility.dll file. The same log should contain the path to the unrecoverable file. Copy the original file from another computer and replace it manually with the damaged one. At this stage, you often have to face problems, since the file may be either used by system processes, or the user will not have rights to it.

To obtain rights and replace such files, you can use standard console utilities Takeown with parameter / f and icacls with parameter / grant administrators: f, but there is a simpler one and universal way- use any "live disk" with a built-in file manager, for example, Dr.Web LiveDisk. If the computer boots, it’s even easier, just copy the original files to any convenient folder on its hard drive.

Edit boot ISO image the same Dr.Web LiveDisk can be UltraISO program by creating a folder in it and copying windows files into it.

Now let's look at how to restore Windows 7/10 system files using such a disk. After booting from the media, find your folder with files (in Dr.Web LiveDisk, the mount point is / cdrom), copy the original files to the clipboard, change to the target directory of the folder win and replace the damaged ones.

If the original files are on Windows disk, look for them in the win location, in the section where you placed them. This method is convenient in that it removes all restrictions on the file Windows systems, allowing you to get exclusive access to it.

Using third-party applications

Development of special programs, which would allow you to recover damaged and deleted system files, does not make sense, since all the functionality necessary for this is available in the system itself. However, there are tools that make it easier to access staff resources using a user-friendly graphical interface. Such, for example, is Microsoft DaRT- boot disk, which is a set of administrative tools, which also includes a module for scanning and restoring Windows system files. The procedure for such a check is shown in the screenshots below.

For a more convenient launch of SFCs, there are also programs Windows Repair and, unlike Microsoft DaRT, they start from the production system.

In Windows Repair, to start the check, go to the Pre-Repair Steps section, shout on the Step 4 (Optional) tab "and press the Check button.

In Glary Utilities, go to the "Modules" tab, select "Service" in the left menu and click "Restore System Files". In both cases, the standard SFC console utility will be launched.

Other ways

As for the question of how to recover completely deleted system files, everything should be clear anyway. If the size of the disk allows, regularly create backups system partition, or at least do not disable system protection, so that in case of something you can roll back to the previous one.

And the last thing I would like to draw your attention to. If you've downloaded and installed a custom build, be prepared for the SFC to more than likely find corrupted files in it. The reason is very simple - collectors very often modify their images, replacing, for example, original icons in libraries and so on. Therefore, before restoring the original files, think about whether you really need it, if the system is not experiencing problems.


2021
maccase.ru - Android. Brands. Iron. news