Windows 10: Run SFC Command in Windows 10  

Page 1 of 17 12311 ... LastLast
    Run SFC Command in Windows 10

    Run SFC Command in Windows 10

    How to Run SFC Command to Repair System Files in Windows 10
    Published by Category: Customization
    14 Mar 2017
    Designer Media Ltd

    Published by


    Brink's Avatar
    Administrator

    Posts: 20,887

    Show Printable Version 


    How to Run SFC Command to Repair System Files in Windows 10

    information   Information
    The SFC command scans the integrity of all protected system files and replaces incorrect versions with correct Microsoft versions.

    This tutorial will show you how to run the sfc command at boot or in Windows 10 to attempt to repair corrupted or modified system files.

    Tip   Tip
    If you get the Windows Resource Protection Could Not Start the Repair Service error when trying to run SFC, then make sure that the Windows Modules Installer service is enabled and set to Manual.

    Note   Note
    If you get a hash mismatch for the opencl.dll file like below, then you can safely ignore this.

    This issue may occur in Windows 10 Version 1511. When you install Windows, it installs a version of opencl.dll. However hardware drivers may also install their own version of opencl.dll, and if the driver version is different than the one installed by Windows, SFC may report this as file corruption and may not replace the file.

    When this happens, the opencl.dll file is not actually corrupt. It is not necessary that you take any action the report that opencl.dll is corrupt can be safely ignored.

    Microsoft is aware of this problem with Windows 10 Version 1511 and is working on a resolution.

    Code:
    2015-12-08 08:47:48, Info   CSI    00003b13 [SR] Cannot repair member file [l:10]"opencl.dll" of microsoft-windows-RemoteFX-clientVM-RemoteFXWDDMDriver-WOW64-C, version 10.0.10586.0, arch Host= amd64 Guest= x86, nonSxS, pkt {l:8 b:31bf3856ad364e35} in the store, hash mismatch
    
    2015-12-08 08:47:48, Info      CSI    00003b1e [SR] Cannot repair member file [l:10]"opencl.dll" of microsoft-windows-RemoteFX-clientVM-RemoteFXWDDMDriver-WOW64-C, version 10.0.10586.0, arch Host= amd64 Guest= x86, nonSxS, pkt {l:8 b:31bf3856ad364e35} in the store, hash mismatch
    
    2015-12-08 08:47:48, Info     CSI    00003b1f [SR] This component was referenced by [l:125]"Microsoft-Windows-RemoteFX-VM-Setup-Package~31bf3856ad364e35~amd64~~10.0.10586.0.RemoteFX clientVM and UMTS files and regkeys"
    
    2015-12-08 08:47:48, Info     CSI    00003b22 [SR] Could not reproject corrupted file [l:23 ml:24]"\??\C:\Windows\SysWOW64"\[l:10]"opencl.dll"; source file in store is also corrupted

    CONTENTS:








    Run SFC Command in Windows 10 OPTION ONE Run SFC Command in Windows 10
    To Run SFC /SCANNOW Command at Boot


    Note   Note
    This option scans the integrity of all Windows system files at boot (offline) and repairs files with problems (ex: corrupted or modified) when possible.

    Running SFC at boot will allow SFC to be able to repair files that are in use in Windows since SFC wouldn't be able to repair them in Windows.


    1. Open a command prompt at boot.

    2. In the command prompt, type diskpart and press Enter, then type list volume and press Enter. (see screenshot below step 3)

    3. Make note of the drive letters for your boot drive (ex: 350MB "System Reserved" partition) and Windows 10 drive, then type Exit and press Enter. (see screenshot below)

    NOTE: If you do not have a "System Reserved" partition, and are not multi-booting with another operating system, then the boot drive and Windows 10 drive may be the same drive letter.

    Name:  SFC_at_boot.jpg
Views: 380760
Size:  59.3 KB

    4. In the command prompt, type the command below, and press Enter. (see screenshot below step 5)

    sfc /scannow /offbootdir=C:\ /offwindir=D:\windows

    Note   Note
    You will need to substitute the C drive letter in the /offbootdir (offline boot directory) command part above with what step 3 shows of the partition/volume where your system boot files are stored (ex: "System Reserved" partition) instead.

    You will need to substitute the D drive letter in the /offwindir (offline windows directory) command part above with what step 3 shows as your Windows 10 partition/volume letter instead.


    5. When the scan is complete, hopefully you will see a Windows Resource Protection did not find any integrity violations message unlike below. (see screenshot below)

    NOTE: You will see a blinking cursor at the prompt until finished. This will take a while to finish running though.

    Name:  SFC-SCANNOW_at_boot.jpg
Views: 378536
Size:  50.2 KB

    6. If no issues were found, then close the command prompt, and restart the computer to start Windows 10.

    Note   Note
    If SFC could not fix something, then run the command again to see if it may be able to the next time. Sometimes it may take running the sfc /scannow command up to 3 times with Fast Startup turned off and restarting the computer after each time to completely fix everything that it's able to.

    If not, then run the Dism /Online /Cleanup-Image /RestoreHealth command to repair any component store corruption, restart the PC afterwards, and try the sfc /scannow command again.

    If still not, then do a system restore using a restore point dated before the bad system file occurred to fix it. You may need to repeat doing a system restore until you find a older restore point that may work.

    If still not, then you could do a repair install without losing anything.

    If still not, then you could refresh Windows 10.

    When running SFC offline (at boot), SFC logging in the CBS.log file is not supported to be able to create a sfcdetails.txt file in OPTION FIVE below.







    Run SFC Command in Windows 10 OPTION TWO Run SFC Command in Windows 10
    To Run SFC /SCANFILE Command at Boot


    Note   Note
    This option scans the integrity of a specified Windows system file at boot (offline) and repairs the file if it has problems (ex: corrupted or modified) when possible.

    Running SFC at boot will allow SFC to be able to repair the file if it was in use in Windows since SFC wouldn't be able to repair the file in Windows.


    1. Open a command prompt at boot.

    2. In the command prompt, type diskpart and press Enter, then type list volume and press Enter. (see screenshot below step 3)

    3. Make note of the drive letters for your boot drive (ex: 350MB "System Reserved" partition) and Windows 10 drive, then type Exit and press Enter. (see screenshot below)

    NOTE: If you do not have a "System Reserved" partition, and are not multi-booting with another operating system, then the boot drive and Windows 10 drive may be the same drive letter.

    Name:  SFC_at_boot.jpg
Views: 380760
Size:  59.3 KB

    4. In the command prompt, type the command below, and press Enter. (see screenshot below step 5)

    sfc /scanfile="full path of file" /offbootdir=C:\ /offwindir=D:\windows

    Note   Note
    You will need to substitute full path of file in the command above with the actual full path of the Windows system file you want to scan. The drive letter will be the same as is shows in step 3 above for your Windows 10 partition/volume letter (ex: D)

    For example: "D:\Windows\System32\imageres.dll"

    You will need to substitute the C drive letter in the /offbootdir (offline boot directory) command part above with what step 3 shows of the partition/volume where your system boot files are stored (ex: "System Reserved" partition) instead.

    You will need to substitute the D drive letter in the /offwindir (offline windows directory) command part above with what step 3 shows as your Windows 10 partition/volume letter instead.

    5. When the scan is complete, hopefully you will see a Windows Resource Protection did not find any integrity violations message like below. (see screenshot below)

    Name:  SFC-SCANFILE_at_boot.jpg
Views: 377953
Size:  33.7 KB

    6. If no issues were found, then close the command prompt, and restart the computer to start Windows 10.

    Note   Note
    If SFC could not fix something, then run the command again to see if it may be able to the next time. Sometimes it may take running the sfc /scannow command up to 3 times with Fast Startup turned off and restarting the computer after each time to completely fix everything that it's able to.

    If not, then run the Dism /Online /Cleanup-Image /RestoreHealth command to repair any component store corruption, restart the PC afterwards, and try the sfc /scannow command again.

    If still not, then you could refresh Windows 10, or do a system restore using a restore point dated before the bad system file occured to fix it. You may need to repeat doing a system restore until you find a older restore point that may work.

    When running SFC offline (at boot), SFC logging in the CBS.log file is not supported to be able to create a sfcdetails.txt file in OPTION FIVE below.





    Run SFC Command in Windows 10 OPTION THREE Run SFC Command in Windows 10
    To Run SFC /SCANNOW Command in Windows 10


    Note   Note
    This option scans the integrity of all system files and repairs files with problems (ex: corrupted or modified) when possible.


    1. Open an elevated command prompt or an elevated Windows PowerShell.

    2. In the elevated command prompt, type the command below, and press Enter. (see screenshot below step 3)

    sfc /scannow

    3. When the scan is complete, hopefully you will see a Windows Resource Protection did not find any integrity violations message unlike below. (see screenshot below)

    NOTE: You will see a blinking cursor at the prompt until finished. This will take a while to finish running though.
    Click image for larger version. 

Name:	SFC-SCANNOW.jpg 
Views:	7129 
Size:	90.3 KB 
ID:	8229

    4. If not issues were found, then close the command prompt.

    Note   Note
    If SFC could not fix something, then run the command again to see if it may be able to the next time. Sometimes it may take running the sfc /scannow command up to 3 times with Fast Startup turned off and restarting the computer after each time to completely fix everything that it's able to.

    If not, then run the Dism /Online /Cleanup-Image /RestoreHealth command to repair any component store corruption, restart the PC afterwards, and try the sfc /scannow command again.

    If still not, then do a system restore using a restore point dated before the bad system file occurred to fix it. You may need to repeat doing a system restore until you find a older restore point that may work.

    If still not, and you would like to get help with your SFC issue before continuing with more drastic measure below, then you could upload and attach your sfcdetails.txt file created using OPTION FIVE below in a reply post in this tutorial.

    If still not, then you could do a repair install without losing anything.

    If still not, then you could refresh Windows 10.






    Run SFC Command in Windows 10 OPTION FOUR Run SFC Command in Windows 10
    To Run SFC /SCANFILE Command in Windows 10


    Note   Note
    This option scans the integrity of a specified Windows system file and repairs the file if it has problems (ex: corrupted or modified) when possible.


    1. Open an elevated command prompt or elevated Windows PowerShell.

    2. In the elevated command prompt, type the command below, and press Enter. (see screenshot below step 3)

    sfc /scanfile="full path of file"

    Note   Note
    You will need to substitute full path of file in the command above with the actual full path of the Windows system file you want to scan.

    For example: sfc /scanfile="C:\Windows\System32\imageres.dll"


    3. When the scan is complete, hopefully you will see a Windows Resource Protection did not find any integrity violations message like below. (see screenshot below)

    Click image for larger version. 

Name:	SFC-SCANFILE.jpg 
Views:	1549 
Size:	50.2 KB 
ID:	8228

    4. If no issues were found, then close the command prompt.

    Note   Note
    If SFC could not fix something, then run the command again to see if it may be able to the next time. Sometimes it may take running the sfc /scannow command up to 3 times with Fast Startup turned off and restarting the computer after each time to completely fix everything that it's able to.

    If not, then run the Dism /Online /Cleanup-Image /RestoreHealth command to repair any component store corruption, restart the PC afterwards, and try the sfc /scannow command again.

    If still not, then do a system restore using a restore point dated before the bad system file occurred to fix it. You may need to repeat doing a system restore until you find a older restore point that may work.

    If still not, and you would like to get help with your SFC issue before continuing with more drastic measure below, then you could upload and attach your sfcdetails.txt file created using OPTION FIVE below in a reply post in this tutorial.

    If still not, then you could do a repair install without losing anything.

    If still not, then you could refresh Windows 10.





    Run SFC Command in Windows 10 OPTION FIVE Run SFC Command in Windows 10
    To View Only the "SFC" Scan Results from the CBS.LOG


    Note   Note
    When SFC runs in Windows, it logs it's actions into the C:\Windows\Logs\CBS\CBS.log file. The steps in this option will show you how to see only the specific SFC entries with the [SR] tags in this CBS.log to not have to see all the other unrelated entries in the CBS.log.

    When running SFC offline (at boot) in OPTION ONE or OPTION TWO, SFC logging in the CBS.log file is not supported to be able to create a sfcdetails.txt file.


    1. Open an elevated command prompt or an elevated Windows PowerShell.

    2. In the elevated command prompt or PowerShell, copy and paste the appropriate command below, and press Enter. (see screenshot below step 3)

    Only for elevated command prompt:
    Code:
    findstr /c:"[SR]" %windir%\Logs\CBS\CBS.log >"%userprofile%\Desktop\sfcdetails.txt"

    Only for elevated PowerShell:
    Code:
    (sls [SR] $env:windir\Logs\CBS\CBS.log -s).Line >"$env:userprofile\Desktop\sfcdetails.txt"

    Click image for larger version. 

Name:	sfcdetails.png 
Views:	913 
Size:	14.5 KB 
ID:	31567

    3. Close the elevated command prompt.

    4. Open the sfcdetails.txt file on your desktop to only see the SFC scan details from the CBS.LOG file.

    5. When finished, you can safely delete the sfcdetails.txt file afterwards if you like.




    That's it,
    Shawn


  1.    01 Jan 2015 #1

    Hi Shawn -Damage with bad performance from a Windows 10 Refresh. Running DISM to attempt to repair some SFC unfixable. Error: 0x800f081f The source files could not be found. Cannot extract SFC from CBS log to desktop (not found). Any suggestions?
      My ComputerSystem Spec


  2. Posts : 20,887
    64-bit Windows 10 Pro build 16199
    Thread Starter
       01 Jan 2015 #2

    Hey Greg,

    It's been my experience that SFC will always find unrepairable files in Windows 10. I suspect that it's because it's still only a preview build and have many patched system files still.

    Do you have a restore point available dated before the DISM error?
      My ComputersSystem Spec

  3.    01 Jan 2015 #3

    No Restore Points queued even though I apportioned 10% disk space.

    was actually doing more repair than I usually have patience for before reinstalling (for practice) but now that you tell me that I'll cut to the reinstall. I did run the CBS log by Noel to see what he says, if he has time for it without being able to extract just the SFC log.

    Thanks and Happy New Year~!
      My ComputerSystem Spec


  4. Posts : 713
    Windows 10 Build 14267
       24 Feb 2015 #4

    I'm experiencing the same issue. SFC /scannow always stops at 2%. I hope that MS fix it in build 100xx !

      My ComputerSystem Spec

  5.    18 Apr 2015 #5

    Thanks Brink another great tutorial!
    Sfc /scannow would not complete - after running the Dism /Online /Cleanup-Image /RestoreHealth the sfc /scannow worked and fully completed, also worked on Windows 8.1.

    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.
    C:\WINDOWS\system32>Dism /online /cleanup-image /restorehealth
    Deployment Image Servicing and Management tool
    Version: 6.3.9600.17031
    Image Version: 6.3.9600.17031
    [==========================100.0%==========================]
    The restore operation completed successfully. The component store corruption was
    repaired.
    The operation completed successfully.
    C:\WINDOWS\system32>sfc /scannow
    Beginning system scan. This process will take some time.
    Beginning verification phase of system scan.
    Verification 100% complete.
    Windows Resource Protection did not find any integrity violations.
    C:\WINDOWS\system32>
      My ComputerSystem Spec


  6. Posts : 54
    windows 10 pro Build 10240 x86
       21 Jul 2015 #6

    i ran SFC /scannow my result came like this "windows resource protection found corrupt files but was unable to fix some of them " is this was ok or something went wrong??
      My ComputerSystem Spec


  7. Posts : 20,887
    64-bit Windows 10 Pro build 16199
    Thread Starter
       21 Jul 2015 #7

    Hello Remostalin,

    That means that SFC was unable to repairs some of your system files that were found to be corrupted or modified.

    If you like, see if doing what's in the note box under OPTION THREE may allow SFC to be able to repair them afterwards.

    If it still cannot, then you could perform OPTION FIVE to get your sfcdetails.txt log and upload it here. I'll be happy to take a look to see and let you know what SFC was unable to repair, and what we may be able to do from there.
      My ComputersSystem Spec


  8. Posts : 54
    windows 10 pro Build 10240 x86
       21 Jul 2015 #8

    Brink said: View Post
    Hello Remostalin,

    That means that SFC was unable to repairs some of your system files that were found to be corrupted or modified.

    If you like, see if doing what's in the note box under OPTION THREE may allow SFC to be able to repair them afterwards.

    If it still cannot, then you could perform OPTION FIVE to get your sfcdetails.txt log and upload it here. I'll be happy to take a look to see and let you know what SFC was unable to repair, and what we may be able to do from there.
    TinyUpload
      My ComputerSystem Spec


  9. Posts : 20,887
    64-bit Windows 10 Pro build 16199
    Thread Starter
       21 Jul 2015 #9

    Luckily, it's just part of the false hash mismatch for the MicrosoftEdgeSquare44x44.scale-125_contrast-white.png file from the KB3074667 update.

    There's nothing that needs to be done or to worry about it.
      My ComputersSystem Spec


 
Page 1 of 17 12311 ... LastLast

Related Threads
How to Open an Elevated Command Prompt in Windows 10 A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands in an elevated command prompt, you can perform tasks that require...
General Tips Open Command Prompt in Windows 10 in Tutorials
How to Open a Command Prompt in Windows 10 A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands at the command prompt, you can perform tasks on your computer without using the Windows...
How to Open a Command Prompt at Boot in Windows 10 A command prompt is an entry point for typing computer commands in the Command Prompt window. By typing commands at the command prompt, you can perform tasks on your computer without using the...
Show Us Your Command Centre in Chillout Room
This is my study. Also my office when I am working. I call it Sanctuary. 327 328
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 04:28.
Find Us