How Exactly Does SFC Fix Corrupt System File?

fernando bonfim 56 Reputation points
2021-09-13T13:16:49.967+00:00

According to some texts I have read, the System File Checker (
SFC
) is a command-line tool that is used to find corrupt system files, and replace them with healthy copies. |1| These copies would come from what is called Windows component store. In the
SFC
description on Microsoft it is said that the source is the %systemroot%\system32\dllcache folder, but it seems that this folder is not used anymore, and it doesn’t even appear in my system. |1||2|[|3|

Component store is where all system files are located, which is currently in the %windir%/WinSxS. The system files elsewhere are just hard links to the files in the component store. This implies that if we change access a system file using a path outside of WinSxS, the modification would also be present if we access the file from withing WinSxS.|4|

Considering that when
SFC
finds a corrupt file, it means that its counterpart in WinSxS is also corrupt, where the
SFC
tool actually find the file it use to replace the defective file detected?

------------------

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,593 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. abbodi86 3,776 Reputation points
    2021-09-13T16:56:43.263+00:00

    C:\Windows\WinSxS\Backup

    files here are independant from hard links


  2. Darrell Gorter 1,291 Reputation points
    2021-09-13T21:56:19.423+00:00

    Hello,
    There are multiple ways the files are replaced.
    The files are checked to ensure the correct file is in place.
    If not it is checked against the WinSxS folder \Windows\WinSxS or \Windwos\WinSxS\backup
    The files in winSxS are the hardlinked to the the Windows Folder such as \Windows or \Windows\System32 to name a couple.
    the hardlinks can be broken, files can be replaced. So the WinSxS store is checked first.
    if that fails, then the system looks to the Internet where there is a file store on the Microsoft site
    files are pulled down from that Store and used to replace the files and generate the hard links again.
    Managing the Windows Component Store


  3. Limitless Technology 39,341 Reputation points
    2021-09-14T14:24:32.123+00:00

    Hello,

    Thank you for reaching out.

    The SFC process is well explained in below Microsoft article which includes to run DISM first to get files from winsxs.

    https://support.microsoft.com/en-us/topic/use-the-system-file-checker-tool-to-repair-missing-or-corrupted-system-files-79aa86cb-ca52-166a-92a3-966e85d4094e#:~:text=The%20sfc%20%2Fscannow%20command%20will,the%20Windows%20operating%20system%20folder.

    Hope this helps.

    Thank you,


  4. Docs 15,141 Reputation points
    2021-09-14T16:28:09.173+00:00
    0 comments No comments