Windows 7 : Repair or Fix the Corrupt Files in Windows 7

Is your computer failing to boot properly? On booting some warning message flashes saying that your computer is missing some system file or messages about missing DLL files or have other indications that there is a problem. The reason behind the Windows boot failure may be some important Windows system files might have got corrupted due to hardware failure or other unknown reasons. The situation becomes worse if your computer automatically restarts and you lose all your unsaved data on the primary Windows partition. To repair the corrupt files follow this tutorial.

repair windows corrupt files

Corrupt windows file can be repaired by the system with System File Checker (SFC.exe). It’s a command line system tool that comes with all current versions of Windows. SFC scans all protected system files and replace incorrect or damaged or missing files with the original copies from a backup cache or from an installation disk or folder. Malware or virus infections are another source of this type of problem; so make sure your system is clean before trying repairs. Also,System Restore is easier to use and should be tried first if possible.

Repair corrupted files using System File Checker (SFC.exe)

Follow this steps, to repair corrupted files using System File Checker (SFC.exe)

  • Open an elevated command prompt. To do this, Click Start > Click All Programs > Click Accessories and right-click Command Prompt, and then click Run as administrator. On prompted for an administrator password or for a confirmation, type the password, or click Allow
  • Type the following command, sfc /scannow and then press ENTER

command window

  • The sfc /scannow command scans all protected system files and replaces incorrect versions with correct Microsoft versions
  • In order to view the corrupted files, in the elevated command prompt, type sfc /verifyonly and press Enter

Once the scan is completed, you will find that the corrupt files are repaired. When done, close the elevated command prompt.

Determine files which could not be repaired by the System File Checker tool

Follow these steps, to determine files which could not be repaired by the System File Checker tool

  • Open an elevated command prompt
  • Type the command, findstr /c:”[SR]” %windir%\Logs\CBS\CBS.log >%userprofile%\Desktop\sfcdetails.txt and then press ENTER

sfcdetails

  • The Sfcdetails.txt file contains details from every time when the System File Checker tool has been run on the computer. The file includes information about files that were not repaired by the System File Checker tool. Verify the date and time entries to determine the problem files that were found the last time that you ran the System File Checker tool. Type sfcdetails.txt in Search programs and files and press Enter. The Sfcdetails.txt file uses the Date/Time SFC detail format.

After running System File Checker it is best to go to Windows Update after any repair is done to ensure that you have the latest file versions.

To Repair files, when SFC tool fails to replace the corrupted file

The System file checker tool automatically fixes all the missing Windows files that were corrupted because of software installations or you may have accidentally deleted them. Sometimes it happens that your computer finds any corrupt or missing file and fails to replace it. In that case, you can always check those files that could not be repaired by the System File Checker tool.

Follow the Steps below to replace the corrupted file

 

  • Open the command prompt window with administrative privileges
  • Now type a command findstr /C:”[SR] Cannot repair member file” %windir%\logs\cbs\cbs.log >sfcdetails.txt and press Enter
  • Go to C drive, click on Windows > click on System 32 folder and open a file sfcdetails.txt. It is a log file that contains entries for a file that could not be repaired by SFC.exe tool. Note down the file name and the location of file
  • In the command prompt, type the command takeown /f C:\windows\system32\filename and press Enter. (filename is the name of missing file)

file ownership

  • Now type icacls C:\windows\system32\abc.dll /grant administrators:F as a command and press Enter (replace the abc.dll with filename in command)
  • Now open Windows explorer and find the copy of that file by searching it using the search box. Suppose you want to find a copy of System.Runtime.Remoting.dll file. You have to type the file name in the search box and it will show all the files inside that folder
  • Note the location of the duplicate file. You need to copy this file to the missing file location
  • Type command Copy Path_And_File_Name_Of_Source_FilePath_And_File_Name_Of_Destination to replace the file with copy of the file
  • For example type copy C:\windows\Microsoft.NET\framework\abc.dll C:\windows\system32\abc.dll to copy abc.dll file from one location to another. Remember you have to change the file name with abc.dll with the missing file name. Upon completion, close the command prompt.

SFC has its place and is part of the regular toolkit. Following the above method, you can replace invalid or corrupt windows files from command prompt and solve your computer issues.

Advertisement

No comments yet.

Leave a Comment