Applies ToWindows 8.1 Windows 8.1 Enterprise Windows 8.1 Pro Windows 8 Windows 8 Enterprise Windows 8 Pro Windows 7 Enterprise Windows 7 Home Basic Windows 7 Home Premium Windows 7 Professional Windows 7 Starter Windows 7 Ultimate Windows Vista Enterprise 64-bit Edition Windows Vista Ultimate 64-bit Edition Windows Vista Business Windows Vista Business 64-bit Edition Windows Vista Enterprise Windows Vista Ultimate Windows 10 Windows 11

When critical Windows system files are missing or corrupted, some Windows features may stop working correctly or Windows may stop responding altogether.  If this happens, you can use the Deployment Image Servicing and Management tool (DISM) and the System File Checker tool (SFC) to scan your system files and restore any corrupted or missing files.

Step 2: Run System File Checker

In the Command Prompt window, type the following command, and press ENTER:

sfc /scannow

Command Prompt with administrator rights - sfc /scannow   

Warning: Do not close this Command Prompt window until the verification is 100% complete.

The sfc /scannow command will scan all protected system files and replace corrupted files with a cached copy.  The scan results will be shown after this process is finished. You may receive one of the following messages:

Scan result message

Corresponding action

Windows Resource Protection did not find any integrity violations.

You do not have any missing or corrupted system files.

Windows Resource Protection could not perform the requested operation.

To resolve this problem, perform the System File Checker scan in safe mode.

Make sure that the PendingDeletes and PendingRenames folders exist under %WinDir%\WinSxS\Temp.

The %WinDir% placeholder represents the Windows operating system folder, such as, C:\Windows.

Windows Resource Protection found corrupt files and successfully repaired them.

The operation was successful. 

To view detailed information about the system file scan and restoration, go to How to view details of the System File Checker process.

Windows Resource Protection found corrupt files but was unable to fix some of them.

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

To view the details included in the CBS.Log file, follow these steps to copy the information in the log to a viewable text file on your desktop:

  1. Open an elevated command prompt, as described previously.

  2. In the Command Prompt window, type the following command (on one line), and then press ENTER:

    findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.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.

  3. Open the Sfcdetails.txt file from your desktop.

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

After reviewing the log file to determine which system file was corrupted and could not be repaired, find where the corrupted file is located, and then manually replace the corrupted file with a known good copy of the file.

To do this, follow the instructions below.  In the following commands, the <Path_And_File_Name> placeholder represents the path and the file name of the corrupted file.

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 as your computer. You may wish to perform a System File Checker process on that computer to make sure the system file that you intend to copy is a good copy.

Step 1: Take administrative ownership of the corrupted system file.

Type the following command in the elevated command prompt and then press ENTER:

takeown /f <Path_And_File_Name>​​​​​​​

Example:

takeown /f C:\windows\system32\jscript.dll

Command Prompt with administrator rights - command succeeded

Step 2: Grant administrators full access to the corrupted system file.

Type the following command, and then press ENTER:

icacls <Path_And_File_Name> /grant administrators:F 

Example:

icacls C:\windows\system32\jscript.dll /grant administrators:F

Command Prompt with administrator rights

Step 3: Replace the corrupted system file with a known good copy of the file.

Type the following command, and then press ENTER:

Copy <Source_File> <Destination>

In the above command, replace the <Source_File> placeholder with the path and file name of the known good copy of the file on your computer, and replace the <Destination> placeholder with the path and file name of the corrupted file.

Example:

copy E:\temp\jscript.dll C:\windows\system32\jscript.dll

If the steps above don't work, you may need to reinstall Windows. For more info, see Recovery options in Windows

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.