How to Repair Defective or Missing System Files in Windows

Many Windows problems are caused by damaged or missing system files. Damaged or missing system files may stem from malware, failed updates, botched installations, and more. System File Checker is a component of Windows which can...

Part 1 of 4:

Starting and Using System File Checker

  1. Picture 1 of How to Repair Defective or Missing System Files in Windows
    Open the Start menu. Click the Start button.
  2. Picture 2 of How to Repair Defective or Missing System Files in Windows
    Search for Command Prompt. Type cmd.exe.
    1. Users of Windows XP must click All Programs then the Accessories subcategory.
  3. Picture 3 of How to Repair Defective or Missing System Files in Windows
    Start Command Prompt as an administrator. Right click cmd.exe to open the context menu and click Run as administrator.
    1. Users of Windows XP must hold the Shift key while right clicking Command Prompt, click Run As to open a dialog window, select the The following user radio button, type Administrator as the user name and the password of the account (usually blank), and click OK.
    2. Click Yes on the User Account Control dialog if it appears.
  4. Picture 4 of How to Repair Defective or Missing System Files in Windows
    Start System File Checker. In Command Prompt, type sfc /scannow and press the Enter key on your keyboard.
  5. Picture 5 of How to Repair Defective or Missing System Files in Windows
    Wait until System File Checker finishes checking and fixing your system.
Part 2 of 4:

Starting and Using System File Checker Via Safe Mode

  1. Picture 6 of How to Repair Defective or Missing System Files in Windows
    Start Windows in Safe Mode with Command Prompt.
  2. Picture 7 of How to Repair Defective or Missing System Files in Windows
    Start System File Checker. In Command Prompt, type sfc /scannow and press the Enter key on your keyboard.
  3. Picture 8 of How to Repair Defective or Missing System Files in Windows
    Wait until System File Checker finishes checking and fixing your system.
  4. Picture 9 of How to Repair Defective or Missing System Files in Windows
    Shut down your computer by typing shutdown -t 0:00 into Command Prompt and pressing the Enter key on your keyboard.
Part 3 of 4:

If You Experience an Error While Trying to Start System File Checker

Picture 10 of How to Repair Defective or Missing System Files in Windows

Start the Trusted Installer and Windows Module Installer Services

  1. Picture 11 of How to Repair Defective or Missing System Files in Windows
    Open the Start menu. Click the Start button.
  2. Picture 12 of How to Repair Defective or Missing System Files in Windows
    Search for Command Prompt. Type cmd.exe.
    1. Users of Windows XP must click All Programs then the Accessories subcategory.
  3. Picture 13 of How to Repair Defective or Missing System Files in Windows
    Start Command Prompt as an administrator. Right click cmd.exe to open the context menu and click Run as administrator.
    1. Users of Windows XP must hold the Shift key while right clicking Command Prompt, click Run As to open a dialog window, select the The following user radio button, type Administrator as the user name and the password of the account (usually blank), and click OK.
    2. Click Yes on the User Account Control dialog if it appears.
  4. Picture 14 of How to Repair Defective or Missing System Files in Windows
    Start the Trusted Installer service. Type net start "trustedinstaller" into Command Prompt and press Enter.
  5. Picture 15 of How to Repair Defective or Missing System Files in Windows
    Start the Windows Modules Installer service. Type net start "windows modules installer" into Command Prompt and press Enter.
  6. Picture 16 of How to Repair Defective or Missing System Files in Windows
    Follow the Steps of Part 1.

If Starting the Services Does Not Resolve the Error

  1. Follow the steps of Part 2 to resolve the problem.
  2. Make sure you aren't attempting to start System File Checker in the 64-bit version of Command Prompt.
    1. The title of the Command Prompt window should not say C:WindowsSysWOW64cmd.exe.
      Picture 17 of How to Repair Defective or Missing System Files in Windows
Part 4 of 4:

Interpreting the System File Checker Results

After System File Checker finishes checking your system for errors, it will present you with a message. The following are the messages and what they mean.

Picture 18 of How to Repair Defective or Missing System Files in Windows

Windows Resource Protection did not find any integrity violations.

  1. This means that no damaged or missing system files were found.
    Picture 19 of How to Repair Defective or Missing System Files in Windows

Windows Resource Protection could not perform the requested operation.

  1. This means that System File Checker failed to work correctly, but it does not necessarily mean that problems were detected.
  2. To fix this error:
    1. Make sure that folders called PendingDeletes and PendingRenames exist under %WinDir%WinSxSTemp.
      1. Press the Win+R keys simultaneously on your keyboard to open the Run dialog.
      2. Type %WinDir%WinSxSTemp into the Run dialog and click OK to open Windows Explorer.
      3. Search for folders called PendingDeletes and PendingRenames in Windows Explorer.
      4. If the folders are missing, copy them into the Windows Explorer window from another computer running the same operating system from the same location.
    2. Follow the steps of Part 2.
      Picture 20 of How to Repair Defective or Missing System Files in Windows

Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log %WinDir%LogsCBSCBS.log.

  1. System File Checker found and fixed problematic system files and a log, which is a summary of the repairs made, has been created.
  2. To view the log (optional):
    1. Press the Win+R keys simultaneously on your keyboard to open the Run dialog.
    2. Type %WinDir%LogsCBSCBS.log into the Run dialog and click OK.
    3. The log will be displayed.
      Picture 21 of How to Repair Defective or Missing System Files in Windows

Windows Resource Protection found corrupt files but was unable to fix some of them. Details are included in the CBS.Log %WinDir%LogsCBSCBS.log.

  1. Problematic files were found, but System File Checker failed to repair some of them.
  2. To fix the files automatically (may not always work):
    1. Boot into Safe Mode.
    2. Open Command Prompt as an administrator. Click the Start button, type cmd, right click the first search result, then click Run as administrator.
    3. Type Dism /Online /Cleanup-Image /RestoreHealth and press Enter.
  3. To fix the files manually (advanced):
    1. Determine the files that need to be repaired.
      1. Open the Start menu. Click the Start button.
      2. Click All Programs in the Start menu.
      3. Expand the Accessories folder in the Start menu.
      4. Start Command Prompt. Click Command Prompt under the Accessories folder.
      5. Type findstr /c:"[SR]" %windir%LogsCBSCBS.log >"%userprofile%Desktopsfcdetails.txt" into Command Prompt and press the Enter key on your keyboard.
      6. Double click the 'sfcdetails.txt file from your desktop to open Notepad.
      7. Navigate through Notepad to look for any corrupted files which System File Checker failed to correct, and note the file names.
    2. Find a working version of the file(s).
      1. On another computer that is running the same edition of Windows as the computer you are trying to repair, locate the file that was not successfully repaired and copy it onto a removable drive.
      2. Search for the file online if it is not available on another computer, and download it from a safe source.
        1. Be sure to check the downloads for viruses before using them to repair the computer.
    3. Take full control of the corrupted system file on the computer you are trying to repair.
      1. On the computer that needs to be repaired, open the Start menu. Click the Start button.
      2. Click All Programs in the Start menu.
      3. Expand the Accessories folder in the Start menu.
      4. Start Command Prompt as an administrator. Right click Command Prompt under the Accessories folder to open the context menu and click Run as administrator.
      5. Click Yes on the User Account Control dialog.
      6. Type takeown /f "" into Command Prompt and press Enter on your keyboard.
        1. should be replaced with the path of the corrupted file that you want to replace. (E.G. Takeown /f "C:WindowsSystem32notepad.exe")
      7. Type icacls "" /GRANT ADMINISTRATORS:F into Command Prompt and press Enter on your keyboard.
        1. should be replaced with the path of the corrupted file that you want to replace. (E.G. icacls "C:WindowsSystem32notepad.exe" /GRANT ADMINISTRATORS:F)
    4. Replace the corrupted file.
      1. Open the Start menu. Click the Start button.
      2. Click All Programs in the Start menu.
      3. Expand the Accessories folder in the Start menu.
      4. Start Command Prompt as an administrator. Right click Command Prompt under the Accessories folder to open the context menu and click Run as administrator.
      5. Click Yes on the User Account Control dialog.
      6. In Command Prompt, type Copy "" "" and press Enter on your keyboard.
        1. should be replaced with the path of the good copy of the file (depending on where you stored the good version of the problematic file).
        2. should be replaced with the path of the bad version of the file.
        3. (E.G. Copy "F:notepad.exe" "C:WindowsSystem32notepad.exe")
Update 04 March 2020
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile