• Checking and restoring the Windows 7 system. Restoring damaged Windows system files using the SFC and DISM commands

    Utility SFC.EXE (S system F iles C hecker) exists in all Windows versions, starting with Windows 2000, and is designed to check the status and restore 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.

    Command line format:

    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 detected 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.

    Starting from 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 part Component Servicing Infrastructure (CSI), providing the necessary changes to the current Windows status, for example, when updating the system ( Windows Update), installing or uninstalling programs and components, updating device drivers, etc. In fact, CBS provides software interface(API) for installers to correctly change the current state of the system. The Windows servicing system logs many events related to monitoring this state, including: special file C:\Windows\Logs\CBS\CBS.log

    The log file CBS.log, among other things, contains detailed information about the progress of the utility scan sfc.exe and its results. For each file scanned, the date, time and additional information about verification. 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 attribute 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 in this example, 100 files were checked in which no deviations were found, and in the next portion the 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 It’s convenient to filter records based on characteristic features of 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 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 the current log file cbs.log can be stored outdated copies magazines in the form compressed files with name 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.

    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 are useful when diagnosing a faulty Windows operating system. 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 it itself operating system and create conditions for the normal execution of the SFC command.

    Fixing 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 the Command Prompt (Admin) option. Additionally, in all versions of Windows, you can search the Start menu/Start screen for “command prompt,” right-click the link, and select “Run as Administrator.”

    For full check system, 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. On Windows 7 and above 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 storage Windows components for damage and will automatically fix any detected problems.

    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 according to the results of execution DISM commands any changes are made, 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. System Restore allows you to return Windows to an earlier state, which will solve the problem if the operating system was still working in that state.

    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 harmed. 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, it is not at all necessary to waste time on diagnostics complex problems when you can just restore factory condition or reinstall Windows.

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

    Materials

    As a result of some Windows 7 malfunctions and infections malware there is a need for analysis file integrity systems. Also, files are often damaged due to improper shutdown of the PC and power surges. Therefore, every “Seven” user should be able to independently check and resuscitate system files on a computer with Windows 7.

    File analysis method

    The main tool for checking and analyzing their integrity in “Seven” is the “SFC.exe” application built into the OS, which can also restore defective files. Regular use of the command to perform the “sfc /scannow” scan will ensure the smooth operation of Windows 7. It is recommended to use it at least once every six months.

    Analysis procedure

    The built-in scan tool in Windows 7 runs as follows:

    Note: Do not close the console until the procedure is complete. Upon completion, the results of the completed program will appear.

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

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

    After this, a “txt” file will appear on the Windows 7 desktop with a list of all files that the program is not able to resuscitate itself. 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 a distribution kit of the “Seven” modification that runs on the user’s PC.

    Algorithm for restoring a damaged file manually

    Now, knowing the exact name and location of the problematic file that the application is in automatic mode could not fix it, it needs to be replaced. To this end, it is necessary to take 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, you should analyze the performance of the following applications:

    1. Locator remote call procedures;
    2. Remote procedure call;
    3. Starting DCOM server processes.

    If these programs are functioning normally, "SFC.exe" will start.

    Also, the utility will not cope with its functions when the “Installer” service Windows modules» The manual startup type of the recovery service is activated.

    Additional analysis methods 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 a subsequent recovery process. To do this, using the algorithm of the instructions given above, you need to use the command “sfc /verifyonly”.
    2. If necessary, you can resuscitate only a specific file by typing in the console: “sfc /scanfile=Location”.
    3. In a situation where you need to analyze Windows installed on another logical partition hard drive, then the command will help: “sfc /scannow /offwindir=Windows directory location.”

    Conclusion

    Some users, at their own discretion, modify files, change icons in Explorer, and the like. After the application works to analyze and correct the integrity of the OS, all adjustments made will be canceled and will again take the default form. Therefore, such computer owners will need to perform all their system modification operations again after the utility has completed its work.

    Good health, my dear readers, site subscribers and lovers of computer topics!

    Yesterday I installed the software and discovered that several components were missing from my system. Decide this problem I could in various ways. Therefore, I decided to devote an article to such a topic as restoration dll files windows 7. The material is interesting, so be careful. Let's go!

    Method one - disk recovery

    The easiest way to get system files back is with installation disk. This is done very quickly. We insert the disk with the system into the drive and boot from it. Next, select Russian everywhere.

    On next stage Pay attention to the system restore line. it is located at the bottom left. We point at it.

    Next, click on the second line, it’s called System Restore.

    Recovering from underneath the system itself

    This recovery method allows manual recovery. Open Start and write the command in the Run line - rstrui.exe. After this, a window like this will open, in which we click next.

    Now put a tick in the line I marked, select the return point and click further.

    Now click ready and wait for it to finish. The computer will reboot and will already be running with a full set of dll files.

    Check and restore via DISM

    This method will help in cases where there are no restore points. Login to the command line using an administrator account. Let's write the following command: DISM.exe /Online /Cleanup-image /Restorehealth. This process refers to the update center of our Windows. It will download files that are damaged from Microsoft servers.

    The process will take quite a while for a long time. Especially if you have a maximum build and 64-bit operating system. After this, the computer will reboot on its own and everything will fall into place.

    Conclusion

    As you can see, you don't need any recovery program dll libraries. You can only try to restore them using these methods. If they do not help, you will have to reinstall the operating system from scratch.

    On this note I will end the material. I hope your files are never lost. And if this happens, you know what to do. I would be grateful if you share this small but useful article with your friends on social networks and subscribe to blog updates to stay up to date with the latest publications.

    The task of treating damaged Windows files 7 can be solved in several ways. The simplest option is to roll back the system configuration to one of the previous working states. However, this is not always feasible, since the corresponding function can be disabled by the user, and control points may be deleted. In addition, recovery will differ depending on whether or not the corrupted data allows the system to boot.

    Using the Command Line

    If the system files have not been damaged so much as to prevent the system from booting, you can try to restore it to full functionality by entering the command line in the standard way:

    1. Press Win and R at the same time, and in the Run window, write down the cmd.exe command. You can also get to the line through the start menu.
    2. Enter sfc /scannow and the scan will start.

    When the Run window opens, make sure that there is a line under the input field notifying the user that the command is running with administrator rights.

    This line may not appear due to User Account Control being enabled.

    Then after launch sfc teams/scannow you will only be able to see a black window for a moment, which will immediately disappear and the scan will not be carried out.

    To avoid this, you must either disable Windows control accounts, or run the application as an administrator by selecting the appropriate item in context menu when you right-click on the command line program icon.

    If the program does not detect an error, a corresponding message will be displayed on the screen upon completion of the check. The utility will also notify you about the detection of various types of errors, which it will try to automatically correct. Next, you only need to reboot the device, after which the problems when accessing the system should disappear.

    Sometimes the utility cannot normal mode cope with fixing damaged important files. You need to do the following:


    The application will most likely be able to solve the problem and the system files will be fixed.

    If you can't log into Windows

    Damage significant files may be such that log into the OS in the usual way will be impossible. In this case, use the standard environment Windows recovery 7, which can be accessed in the manner already described through F8 or through the installation disk or boot disk. You can create the latter in advance using the OS itself.

    A boot disk may be needed in case of serious damage to the file system, when without it it is impossible to boot not only the system, but also the environment in which the OS can be restored. The emergency storage is used as follows:

    1. By inserting a disc or bootable USB flash drive, go to the boot menu of the device. For laptops, this is usually the F12 key, which must be pressed immediately after turning on the power. IN desktop computers these may be buttons F8-12, etc., depending on the motherboard.
    2. In the window boot menu select the device from which the subsequent boot should be made - optical disk or flash drive. If this function is not available for your device, you will have to change the appropriate BIOS settings.
    3. After selecting your language, click “Next” in the next window.
    4. When using the installation disc in the window Windows installations you need to click on the link at the bottom of the window.
    5. In the options menu, highlight the first option and select your operating system. Surely you only have one installed and you can only select Windows 7 from the list, click “Next”.
    6. In the tool menu that opens, to restore the OS, select the bottom line to open the command line window.
    7. Here you will need to run the same application, but the command will be longer: sfc /scannow /offbootdir=N:\ /offwindir=D:\windows, where N is the disk partition on which Windows system files are stored.

    The program will scan the system and, if necessary, replace all damaged files, after which the system will operate normally.

    If you don't use boot disk, then in the window for selecting boot options that opens after pressing F8 when turning on the power, you will need to select the first troubleshooting item. After this, you will be taken to the options window discussed above.

    How to find out the letter of the system partition if you have forgotten it

    If you suddenly cannot remember the letter of the partition with Windows installed, you can find it directly from the command line. To do this:

    1. IN command line write down the line notepad, the standard “Notepad” will open;
    2. In the menu at the top, select “File”, in the list, click on the “Open” command;
    3. In this way, you will be taken to the usual Explorer, where in “My Computer” you can see all your disks and partitions.

    Partition letters can be found out even easier using one of the standard commands:

    1. At the command prompt, type Diskpart.
    2. After pressing Enter, write down the list disk command, the screen will show all the physical disks installed on the device, each of which will be assigned a number starting from zero.
    3. The select disk command with its serial number select the required drive. If physical disk only one, enter select disk 0;
    4. Next, write down the detail disk - it will be displayed detailed information about the disk and all its partitions.