Checking the integrity of windows 7 from the command line. Checking system files for errors. Recovering damaged files in manual mode

Even the most "licked" and the most protected operating system is by no means guaranteed against errors perceived by the user as errors. Particularly annoying are unknown and unexpected errors sometimes fraught with extremely unpleasant consequences.

It's not hard to imagine the emotions of a person working on a complex document that gets lost as a result of a Windows system crash. To avoid similar problems- it is better to prepare for them in advance. And for this you need to be aware of how the Windows 7 OS is checked for errors. Consider separately two serious issues related to the stated topic:

Old-timers computer world well remember the utilities of the world-famous Peter Norton - not only the author of excellent books, but also the creator of programs under the brand name "Norton utilities". The first versions of these programs worked even before the appearance of windows- in the then popular MS DOS operating system. These utilities allowed to detect the presence of errors on the hard drive and identify the presence of other DOS problems. We will be interested in similar tools for Windows.

Files and registry

Checking OS files can be done in two ways: either using standard Windows tools, or using a third-party software... The OS has built-in file control tools. To use their capabilities, you need to open a window command line and type the sfc command in it with the / scannow parameter, like this:

As a result, the system files will be scanned for errors. The result will be displayed immediately in the command line window.

The information obtained can be analyzed (at least with the help of the same Internet), which is useful for determining the degree of deterioration of the OS and equipment. In the process, the program will try to fix all detected violations in the system files on the disk.

Additional service, better scan quality and reliability of corrections are provided by third-party software.

For example, the same package "Norton Utilities" (NU) for Windows. Though this remedy and is the most popular and powerful software package for dealing with OS and computer malfunctions - it still costs a lot of money. Especially in its "professional" configuration. Nowadays, on the Web, you can find many free analogs of this creation.

The Windows registry is the very place where, in addition to the necessary information for the OS, a lot of junk and garbage accumulates. Periodic cleaning of the registry is our direct responsibility. To this end, it is worth installing and periodically running the time-tested CCleaner utility (although NU does a pretty good job of this as well). Search it online and download it.

HDD

The appearance of errors in the file structure on the hard disk is caused by wear of the disk surface, malfunctions of Windows disk services (drivers) and positioning errors of the laser subsystem of the hard drive. Check and cure HDD can be done in ways similar to the previous ones. We will consider the easiest way - launch standard program the disk error checker that ships with Windows. For this:

  • Open the shortcut "My Computer", select the icon of any of the sections (for example, " Local disk WITH").
  • Open the context menu right click mice.
  • Select Properties. A tabbed window will open.
  • Go to the "Service" tab
  • Click on the "Check" button.

The program will examine the section and fix any malfunctions. Perform the same operation with the rest of the sections.

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 on 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 the command to perform the sfc / scannow check will ensure the smooth operation of Windows 7. 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 is unable to cope with the repair of 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 kit 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 does not 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 you need, for example, 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 command "sfc / verifyonly".
  2. If necessary, only a specific file can be reanimated by typing in the console: "sfc / scanfile = Location".
  3. In a situation where you need to analyze the "Windows" installed on another logical partition of the 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 worked to analyze and correct the integrity of the OS, all the adjustments made will be canceled and will return to the default form. Therefore, such computer owners will need to perform all their operations to modify the system after the utility is completed.

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.

Several tools are available to check the integrity Windows files 10. 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 start, 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 have been detected by OS Resource Protection.
  • If you decide to check any one determined from the system files, then in the 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, therefore it is best to use SFC exclusively when starting "Restore Windows environment 10".

Running SFC Using Recovery Environment

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

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

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 need to be performed only 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 defects, damage different components Windows 10. Deep check, 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 in offline mode, 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 malware in the work of the computer, will return the performance to its work, will avoid extreme measures, such as a complete 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 with the help of special commands and utilities, and your computer will continue its work.

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

When to use these commands

These commands come in handy when diagnosing a faulty operating room. Windows systems... If the system issues blue screen, applications crash or some system functions do not work, the SFC command can help. Even if nothing is fixed after executing the SFC command, this will provide an opportunity to make sure that the system files are not damaged and you can continue diagnostics in other ways.

The DISM command is not required under normal circumstances. But if the SFC fails or cannot replace the damaged files with normal ones, DISM or the System Upgrade Readiness Tool can fix the operating system itself and create the conditions for the SFC to execute normally.

Correcting system files with the SFC command

The SFC command must be run as an administrator. To do this, in Windows 10 or 8.1, right-click on the Start icon and select Command Prompt (Admin). In addition, in all Windows versions you can search in the start menu / on home screen according to "command line", right-click on the desired link and select "Run as Administrator".

For a complete system check, enter the following command in the command prompt window and press:

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

If the message "Windows Resource Protection found corrupt files but was unable to fix some of them" appears, first try to boot into Safe Mode. In Windows 10, 8.1 or 8, hold down the key while selecting the "Restart" option in the shutdown menu to get to the advanced boot options selection screen. On Windows 7 and above early versions restart your computer and hold down the key during startup. Once booted into safe mode, run the sfc / scannow command again.

Troubleshooting SFC Issues with DISM Command

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

To run this tool, open a Command Prompt window as administrator, enter the following command and click. DISM will check the store Windows components for damage and will automatically repair any problems it finds.

DISM / Online / Cleanup-Image / RestoreHealth

Do not close the Command Prompt window until the process is complete. Verification can take up to 10 minutes. If the progress bar stays at 20% for a long time - do not worry, this is normal.

If any changes are made as a result of the DISM command, restart your computer. After that, run the SFC command again and it can replace the damaged files with the correct ones.

There is no DISM command in Windows 7 and earlier. Alternatively, you can download the System Update Readiness Tool from Microsoft, which allows you to check your system for problems and try to fix them.

System restore or reset

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

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

If you get other errors while running the commands above, try searching the Internet for their descriptions. Often the output of a command contains information about the log files (logs), which can be used to find more detailed information about specific problems. And in the end, you don't have to spend time diagnosing complex problems when you can simply restore the factory state or reinstall Windows.

The commands described above have other options as well. For example, SFCs can be used to check and repair individual system files. And with DISM, you can perform a quick system check without fixing it, or point the utility to a WIM or ESD file that contains Windows system files.

Materials (edit)

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

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

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

So, let's run:

and enter into it sfc / scannow:


The system check will start:


You just have to wait.

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

sfc
where:
/ scannow - performs an immediate scan of all protected system files.
/ scanonce - a one-time scan of all protected system files at the next system boot.
/ scanboot - check all protected system files on every boot
/ REVERT - Sets the original default options.
/ ENABLE - Enables the normal operation of Windows file protection
/ PURGECACHE - Cleaning file cache and check files immediately
/ CACHESIZE = x - Sets the size of the file cache

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

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

That's all for me. Thank you all for your attention.