User Tools

Site Tools


Sidebar

microsoft_windows:fix_corrupt_system_files

Fix Corrupt System Files

Occasionally, Windows systems files can become corrupted. You may notice that you get weird errors when running programs, or things may be very slow. Microsoft has the Systems File Checker (sfc) which, when run with administrative permission, checks and optionally repairs files. To run this, start an elevated command prompt by right clicking on cmd and selecting Run As Administrator, then execute the following command. Note that this can take a while.

sfc /scannow

sfc will show feedback on how far it is on the process and, if there are corrupted files, what it has done to replace them. You can also run this from a different Windows install by removing the system hard drive and plugging it into a second Windows machine as a slave, or by booting from a Windows Installation Disk or Flash Drive. In this case, you will need to tell it which one you are trying to repair. Assuming the drive you are trying to repair is d:, the following command will work:

sfc /scannow /offbootdir=d:\ /offwindir=d:\windows

Occasionally, sfc can not do the repair. You can look at C:\Windows\Logs\CBS\CBS.log with a text editor to see what is causing the problem. If the problem is bad enough, you may need to use dism to install a fresh copy of the affected files from the Microsoft web site. In this case:

  1. Clean all temporary files
  2. Reboot system
  3. Run dism
    Dism /Online /Cleanup-Image /RestoreHealth

    from a command prompt

  4. Reboot System
  5. Run
    sfc /scannow

    from a command prompt again and see if it still finds corrupted files

microsoft_windows/fix_corrupt_system_files.txt · Last modified: 2020/01/02 22:38 by rodolico