Checking windows xp system files. Checking Windows system files for integrity

Utility SFC.EXE (S system F iles C hecker) exists in all Windows versions, starting with Windows 2000, and is intended for status checking and recovery system files. Protection Mechanisms important files V different versions Windows are implemented differently, but they all take into account the fact that some system files (usually executable files.exe, library files.dll, driver files) can be modified by a third party software, and there must be a mechanism to verify their integrity and discard detected changes.

Format command line:

SFC

Command line options:

/SCANNOW- Checking the integrity of all protected system files and, if possible, restoring problematic files.

/VERIFYONLY- Checking the integrity of all protected system files. File recovery is not possible.

/SCANFILE- Integrity check specified file and its restoration when problems are detected. In the parameter file the full path must be specified

/VERIFYFILE- Checking the integrity of the file, the full path to which is specified in the parameter file. File recovery is not possible.

/OFFBOOTDIR- Offline download directory location for offline recovery

/OFFWINDIR- Location offline Windows directory for offline recovery

Examples of using the SFC command:

sfc/?- display a hint for use.

sfc /scannow- check the integrity of system files and restore damaged ones. The results of the work are recorded in the utility log \Windows\Logs\CBS\CBS.log.

sfc /verifyonly- perform only a scan of system files without fixing.

sfc /VERIFYFILE=c:\windows\system32\cmd.exe- scan only the file cmd.exe

sfc /SCANFILE=d:\windows\system32\kernel32.dll /OFFBOOTDIR=d:\ /OFFWINDIR=d:\windows- scan only the file kernel32.dll from the operating system installed on logical drive D:. When scanning files standalone Windows, Log file logging is not currently supported.

While the program is running, information about the scanning progress and work results is displayed on the screen. Example output when using scan with patch command sfc /scannow:

System scan has started. This process may take some time.

Beginning of the verification stage of a system scan.
Verification is 100% complete.

Protection program Windows resources discovered damaged files and successfully restored them. For details, see the CBS.Log file, which is located in the following path: windir\Logs\CBS\CBS.log. For example, C:\Windows\Logs\CBS\CBS.log. Please note that logging is not currently supported for offline maintenance.

Beginning with Windows Vista, the operating system component is used as a maintenance tool Component-Based Servicing (CBS)- special set software to ensure its integrity. CBS is a part Component Servicing Infrastructure (CSI), providing the necessary changes to the current Windows status, for example, when updating the system (Windows Update), installing or removing programs and components, updating device drivers, etc. In fact, CBS provides an application programming interface (API) to installers to gracefully change the current state of the system. The Windows servicing system records many events related to monitoring this state in a special file C:\Windows\Logs\CBS\CBS.log

The log file CBS.log, among other things, contains details about the progress of the utility scan sfc.exe and its results. For each file scanned, the date, time, and additional scan information are recorded. After every 100 checks, summary information is displayed, accompanied by a tag , which allows you to select from a fairly voluminous text only those records that contain this characteristic using the search string command in a text file findstr:

findstr /c:"" %windir%\logs\cbs\cbs.log >sfcdetails.txt- find lines containing and output them to a file sfcdetails.txt current directory.

An example of the contents of a log file containing only lines with the tag :

00004b78 Verifying 100 (0x00000000000000064) components
00004b79 Beginning Verify and Repair transaction
00004be0 Verify complete
00004be1 Verifying 100 (0x00000000000000064) components
00004be2 Beginning Verify and Repair transaction
00004c30 Repairing corrupted file "\??\C:\WINDOWS\System32\cmd.exe" from store
00004c5a Verify complete
. . . .
00005594 Committing transaction
00005599 Verify and Repair Transaction completed. All files and registry keys listed
in this transaction have been successfully repaired

In this example, 100 files were checked in which no deviations were found, and in the next portion a file was detected and successfully corrected msprivs.dll.mui. The last 2 lines indicate that the work has completed and that all files and registry keys have been successfully restored.

In cases where the damaged file could not be recovered, the log will contain a line containing:

Cannot repair member file Filename Detailed information about the file

The reason for the impossibility of recovering files may be a hardware malfunction or a violation of the integrity of file system, damage to the reference file storage, etc. In most cases, except for hardware failure, knowing the name of the damaged file, you can perform recovery using copying from the distribution kit or directories of a similar operating system.

To search for information in the text of magazines cbs.log conveniently filter records by characteristic features events recorded in the log:

findstr /c:"Cannot repair" %windir%\logs\cbs\cbs.log >sfcnotrepair.txt sfcnotrepair.txt only those log lines cbs.log, which contain the string Cannot repair, i.e. At the output we will receive a list of system files that could not be restored.

findstr /c:"succsessfylly repaired" %windir%\logs\cbs\cbs.log >sfcnotrepair.txt- write to a text file sfcnotrepair.txt only those log lines cbs.log, which contain the string succsessfylly repaired, i.e. At the output we will receive a list of system files that were recovered.

In the catalog \Windows\Logs\CBS\ except current file magazine cbs.log legacy copies of logs may be stored as compressed files named CbsPersist_YYYYMMDDnnnnnn.cab, which, if necessary, can be unpacked for further in-depth analysis.

IN Windows environment 8-10 for recovery system components Windows, it is possible to use the utility Dism.exe, which supports (which did not exist in Windows Vista/Windows 7) the parameter RestoreHealth:

dism /Online /Cleanup-Image /RestoreHealth- to restore system files of the current Windows OS.

For Windows 7 parameter /RestoreHealth is not applicable and the recovery functions are combined with the scanning functions specified by the parameter /ScanHealth:

dism /Online /Cleanup-Image /ScanHealth- to restore system files of the current Windows 7 OS.

). 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 happens, because... The article is not about this and I have already given a link to solving problems above.
I’d rather show you one interesting way that will help you check your system for errors.

Few people know, but in Windows OS there is one useful “little thing” that can search And correct errors in the system itself. Moreover, it will not touch third-party programs, but will 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 feverishly begin, and so on. All in all . Yes, it is useful and can lead to good result, but with all these actions it is good to remember something else that 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 system files, which are often forgotten. But still, within the framework of this article, I will repeat...

So, let's run:

and enter it into sfc /scannow:


The system check will begin:


All you have to do is wait.

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

sfc
Where:
/scannow – immediately scans all protected system files.
/scanonce – scans all protected system files once at the next system boot.
/scanboot – scans all protected system files at every boot
/REVERT – Sets the initial parameters to default.
/ENABLE – Enable normal operation of protection Windows files
/PURGECACHE – Clear file cache and check files immediately
/CACHESIZE=x – Sets the file cache size

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

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

That's all I have. Thank you all for your attention.

If there are problems with your computer, it’s a good idea to check the OS to determine the integrity of the system files. Damage or deletion of these objects is often the cause incorrect operation PC. Let's see how you can perform this operation in Windows 7.

If you notice any errors in the operation of your computer or its incorrect behavior, for example, the periodic appearance of a blue screen of death, then, first of all, it is necessary. 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 performed 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 to scan your computer for damage to 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 operating system tools.

Method 2: Glary Utilities

The next comprehensive program for optimizing computer operation, with which you can check the integrity of system files, is. 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 operating system installation disk before starting the tool. 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.

The most common cause of 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 various 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 produce this type check, there is no point in downloading and installing third-party software. 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 only the performance of Windows itself, but also the programs and applications that were installed on the computer depend on the integrity of system files. If you encounter an error, the program does not start or the PC is slow, it is worth checking the system for the integrity of the files and, if necessary, restoring them.

How to check Windows 7 for the integrity of system files?

Using standard tools, you can check Windows 7 for the integrity of system files as follows:

  • Press “Win+R” and enter “cmd”.
  • A command prompt will open. In the console, enter “sfc /scannow”.

  • A system scan will start, after which a report on the status of system files will be provided.

In cases where, when running the command, a message appears that “Windows Resource Protection was unable to start the recovery service...”, then you should do the following:

  • Press “Win+R” and enter “services.msc”.

  • The services window will open. Here you need to find and enable “Windows Module Installer”.

  • For this double click start the service and set the startup type to “Manual”.

  • Then we reboot the system and repeat running the command in the line.

How to perform system file recovery in Windows 7 in different ways?

The “sfc /scannow” command, in addition to scanning, also restores system files. However, if she was unable to “repair” these files, it is worth doing the following:

  • At the command line, enter: findstr /c:"" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfc.txt".

  • Will appear on the desktop Text Document“SFC”, which will present a list of files that could not be recovered.

  • We find damaged files in the list and copy their versions from the working PC. After replacing damaged files, the system will work correctly.

You can also scan and restore system files from the recovery environment using the MSDaRT tool. Initially download and record ISO image"ERD Commander" system recovery disk. After booting from installation disk or flash drives, select the appropriate item.

A new window will appear. Select "System File Checker".

The System File Recovery Wizard will launch. We follow the instructions.

Check the “Scan and request before correction” checkbox.

A search for damaged files will begin. Afterwards, a window with a report will appear, where you need to put a mark next to the defective element and click “Next”.

After recovery, reboot the PC.

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 will be useful 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 executing the SFC command does not fix anything, this will allow you to verify 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 command fails or fails to replace damaged files with normal ones, DISM or System Update Readiness Tool can fix the operating system itself and allow the SFC command to run normally.

Fixing system files with the SFC command

The SFC command must be run as an administrator. To do this, on Windows 10 or 8.1, click right click Click on the Start icon and select the Command Prompt (Admin) option. Additionally, in all versions of Windows, you can search in the Start menu/on home screen According to the words “command line”, right-click on the desired link and select “Run as Administrator”.

To perform a full system scan, 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, at the end of the scan the message “Windows Resource Protection did not find any integrity violations” will appear.

If you see the message "Windows Resource Protection found corrupt files but was unable to fix some of them", first try booting your system into safe mode. In Windows 10, 8.1 or 8, to do this, hold down the key when selecting the “Restart” option in the shutdown menu to get to the selection screen additional parameters downloads. In Windows 7 and earlier versions, restart your computer and hold down the key during startup. After booting into safe mode, run the sfc /scannow command again.

Fixing SFC problems with the DISM command

On Windows 10, 8.1, and 8, fix component store corruption that prevents normal operation SFC, you can use the Deployment Image & Servicing Management (DSIM) tool.

To run this tool, open a Command Prompt window as an administrator, type the following command, and click . DISM will check the Windows Component Store for corruption and automatically fix any problems found.

DISM /Online /Cleanup-Image /RestoreHealth

Do not close the Command Prompt window until the process is complete. The verification may take up to 10 minutes. If the progress bar stays at 20% for a long time, don’t worry, this is normal.

If any changes are made as a result of running the DISM command, restart your computer. Once done, run the SFC command again and it will be able to replace the corrupted files with the correct ones.

In Windows 7 and earlier versions, the DISM command is not available. Instead, you can download from the official website Microsoft Tool checking the system's readiness for an update, which allows you to check the system for problems and try to fix them.

Restoring the system or restoring it to its original state

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

You can also reset Windows to its factory state or reinstall it. In Windows 10, 8.1 and 8, you can use the Computer Restore function () which allows you to return Windows to original state. After this, you will have to reinstall all programs, but user files will not be affected. In Windows 7 and earlier, you should use a recovery partition created by your computer manufacturer, or simply reinstall Windows from scratch.

If you encounter other errors when running the commands described above, try searching for their description on the Internet. Often the command output contains information about log files that can provide more detailed information about specific problems. And in the end, there's no need to waste time diagnosing complex problems when you can simply perform a factory reset or reinstall Windows.

The commands described above have other capabilities. For example, you can use SFC to check and fix individual system files. And with using DISM can be done quick check systems without fixing or point the utility to WIM file or ESD containing Windows system files.

Materials