Use the SFC command to fix the Windows 10 system files

Use the SFC command to fix the Windows 10 system files

If you notice that your computer is frequently corrupted or having problems during startup… then the most likely cause is that the Windows system files are corrupted, lost or even changed. You install a program, some software on the computer.

Although Windows 10 protects the system files needed to keep your computer operating properly, your application files, drivers, and even Windows Update are quite good. However, in some cases, errors may occur.

As with previous versions of Windows, Windows 10 is also included with System File Checker (SFC). This utility will scan, verify, and repair any faulty files on your system.

1. Scan and fix system files on Windows 10

1. Press Windows + X to open the Power User Menu and select Command Prompt (Admin). The reason is because you have to run the SFC command under Admin.

On the Command Prompt window, enter the following command and press Enter:

sfc /scannow

3. After the scan is complete, you will see one of the following messages on the screen:

Windows Resource Protection did not find any integrity violations.

Windows Resource Protection could not perform the requested operation:If this message appears, it means that during the scan, a problem has occurred and an offline scan request is required.

Windows Resource Protection found corrupt files and successfully repaired them. Details are included in the CBS.Log %WinDir%LogsCBSCBS.log: You will receive this message if the SFC can correct the problem you are experiencing. Now you can move or view detailed information.

Windows Resource Protection found corrupt files but was unable to fix some of them: In this case, you have to fix the corrupted files manually.

2. See the  SFC scanning process

To view the details of a System File Checker stored on a CBS.Log file, you must copy a readable copy of the Desktop:

1. Press the Windows + X key combination to open the Power User Menu and select Command Prompt.

On the Command Prompt window, enter the following command and press Enter:

findstr /c:"[SR]" %windir%LogsCBSCBS.log >"%userprofile%Desktopsfclogs.txt"

3. Open sfclogs.txt on your desktop with Notepad. This file will contain all the details of scanned system files and unmanaged file information.

Note: The SFC scanning details are only available when you scan in Windows, not available when you scan offline in the Command prompt.

3. Scans and fixes system files on Windows 10 Offline

1. Press the Windows + I key combination to open the Settings application.

2. On the Settings screen, click Update & security.

3. Next, click on Recovery.

4. Under Advanced startup, click Restart now.

5. Select Troubleshoot.

6. Click Advanced options.

7. Click on Command Prompt to boot your computer just by Command Prompt.

8. During reboot you will receive a message to enter the username (user) and password to continue.

9. Whenever you need to run SFC outside of Windows, you must notify the utility exactly where the Windows installation files are.

On the Command Prompt window, enter the following command to let the utility understand the Windows and System Reserved partitions:

wmic logicaldisk get deviceid, volumename, description

10. Enter the following command in the Command Prompt window and press Enter:

sfc /scannow /offbootdir=C: /offwindir=D:Windows

Note:

In the treen command, use /offboodir to convert the specific drive letter of the System Reserved partition, in this case C and /offwindir to move the specific location of Windows files, in this case D:Windows.

11. After the scan is complete, close the Command Prompt window.

12. Click Continue to exit and return to Windows 10.

4. Manually edit system files on Windows 10

If System File Checker can not fix one or more errors, you will have to manually repair these files.

Open the file sfclogs.txt to view the files that are corrupted, search for the file location and follow the steps below:

1. Press Windows + X to open the Power User Menu, then select Command Prompt (Admin).

2. On the Command Prompt window, enter the following command and press Enter:

takeown /f C:Path-and-File-Name

Note:

Replace C:Path-and-File-Name with the path and filename of the error. Such as C:WindowsSystem32appraiser.dll.

3. Allow access to faulty files under Admin by entering the following command into Command Prompt and press Enter:

icacls C:Path-and-File-Name /Grant Administrators:F

4. Replace the files in the prompt by copying the following command and then pressing Enter:

copy C:Path-SOURCE-and-File-Name C:Path-DESTINATION-and-File-Name

Note:

This command replaces C:Path-SOURCE-and-File-Name with a good path and filename, and replaces C:Path-DESTINATION-and-File-Name with the target path and filenames. error.

For example, copy D:Filesappraiser.dll C:WindowsSystem32appraiser.dll.

5. Enter Yes and press Enter to confirm the overwrite.

After replacing the files, you can enter the SFC / verifyonly command into the Command Prompt window and press Enter to check the integrity of all files and check for any corrupted files to fix.

Also if you just want to fix some files, you can check the integrity of each file using the command:

sfc /VERIFYFILE=C:Path-and-File-Name

For example: sfc /VERIFYFILE=C:WindowsSystem32kernel32.dll.