Run the System File Checker tool (SFC.exe)
- Open an elevated command prompt. To do this, do the following as your appropriate:
- At the command prompt, type the following command, and then press ENTER:
sfc /scannow
The sfc /scannow command will scan all protected system files, and replace corrupted files with a cached copy that is located in a compressed folder at %WinDir%System32dllcache.
The %WinDir% placeholder represents the Windows operating system folder. For example, C:Windows.Note Do not close this Command Prompt window until the verification is 100% complete. The scan results will be shown after this process is finished.
- After the process is finished, you may receive one of the following messages:
-
This means that you do not have any missing or corrupted system files.
-
To resolve this problem, perform the System File Checker scan in safe mode, and make sure that the PendingDeletes and PendingRenames folders exist under %WinDir%WinSxSTemp.
-
To view the detail information about the system file scan and restoration, go to How to view details of the System File Checker process.
-
To repair the corrupted files manually, view details of the System File Checker process to find the corrupted file, and then manually replace the corrupted file with a known good copy of the file.
-
More Information
How to view details of the System File Checker process
- Open an elevated command prompt as described in the previous step 1.
- At the command prompt, type the following command, and then press ENTER:
findstr /c:"[SR]" %windir%LogsCBSCBS.log >"%userprofile%Desktopsfcdetails.txt"
Note The Sfcdetails.txt file contains details from every time that 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.
- Open the Sfcdetails.txt file from your desktop.
- The Sfcdetails.txt file uses the following format:
Date/Time SFC detail
The following sample log file contains an entry for a file that could not be repaired:
2007-01-12 12:10:42, Info CSI 00000008 [SR] Cannot repair member file [l:34{17}]"Accessibility.dll" of Accessibility, Version = 6.0.6000.16386, pA = PROCESSOR_ARCHITECTURE_MSIL (8), Culture neutral, VersionScope neutral, PublicKeyToken = {l:8 b:b03f5f7f11d50a3a}, Type neutral, TypeName neutral, PublicKey neutral in the store, file is missing
How to manually replace a corrupted system file with a known good copy of the file
After you determine which system file was corrupted and could not be repaired through the detail information in the Sfcdetails.txt file, find where the corrupted file located, and then manually replace the corrupted file with a known good copy of the file. To do this, follow these steps:
Note You may be able to get a known good copy of the system file from another computer that is running the same version of Windows with your computer. You may perform a System File Checker process on that computer to make sure the system file that you intend to copy is a good copy.
- Take administrative ownership of the corrupted system file. To do this, at an elevated command prompt, copy and then paste (or type) the following command, and then press ENTER:
takeown /f Path_And_File_Name
Note The Path_And_File_Name placeholder represents the path and the file name of the corrupted file. For example, type takeown /f C:windowssystem32jscript.dll.
- Grant administrators full access to the corrupted system file. To do this, copy and paste (or type) the following command, and then press ENTER:
icacls Path_And_File_Name /GRANT ADMINISTRATORS:F
Note The Path_And_File_Name placeholder represents the path and the file name of the corrupted file. For example, type icacls C:windowssystem32jscript.dll /grant administrators:F.
- Replace the corrupted system file with a known good copy of the file. To do this, copy and paste (or type) the following command, and then press ENTER:
Copy Source_File Destination
Note The Source_File placeholder represents the path and file name of the known good copy of the file on your computer, and the Destination placeholder represents the path and file name of the corrupted file. For example, type copy E:tempjscript.dll C:windowssystem32jscript.dll.