The command: "sfc" is on Windows 12, 11, 10, .. , MS Server 2025, 2022, 2019, .. available
Here are detailed technical descriptions for examples of the
`SFC` (System File Checker) command:
Example 1: Check and restore system files:
SFC /scannow
-
`SFC /scannow`: This command is used to scan the system for corrupted or missing system files and restore them if necessary.
- The command starts a comprehensive scan of all protected system files and tries to replace corrupted versions with correct copies from the Windows installation directory.
Example 2: Check and restore system files with specific path:
SFC /scanfile=C:\Windows\System32\example.dll
-
`SFC /scanfile`: This command allows scanning and restoring a single file (for example
"example.dll") without the full system scan.
- The specified file path indicates the file to be checked and, if necessary, restored.
Example 3: Check and restore system files from a specific backup catalog:
SFC /restorehealth
-
`SFC /restorehealth`: This command is used to restore corrupted system files from a backup catalog (usually on the Windows installation DVD).
- The command attempts to repair the system using saved information from a restore point.
Example 4: Check and restore system files with logging:
SFC /scannow /log=C:\SFC-Log.txt
-
`SFC /scannow`: This command performs a scan and restore of system files.
-
`/log=C:\SFC-Log.txt`: The parameter specifies that a log of the check is created in the specified text file. This can be useful for monitoring and analyzing the results of the review.
Example 5: Check and restore system files with offline image:
SFC /scannow /offbootdir=C:\ /offwindir=D:\Windows
-
`SFC /scannow`: The command starts scanning and restoring system files.
-
`/offbootdir=C:\`: Specifies the drive where the system partition is installed.
-
`/offwindir=D:\Windows`: Specifies the directory where Windows is installed. This can be useful if the system being checked is not the currently booted system.
Example 6: Verify and Restore Specific Files with Retry:
SFC /scanfile=C:\Windows\System32\example.dll /offwindir=C:\Windows /offbootdir=C:\ /scanfileonce
-
`SFC /scanfile`: This command scans and attempts to restore the specified file.
-
`/offwindir=C:\Windows`: Specifies the directory where Windows is installed.
-
`/offbootdir=C:\`: Specifies the drive where the system partition is installed.
-
`/scanfileonce`: The parameter ensures that the specified file is only scanned once.
These examples provide various use cases of the
`SFC` command, from system-wide scanning to targeted scanning and recovery of specific files. It is important to choose the appropriate options based on the specific needs and problems.
It is important to note that the
`SFC` command requires elevated privileges. Therefore, Command Prompt should be run as administrator. The
`SFC` command can be used for troubleshooting and maintaining the Windows operating system, especially when problems arise with corrupted system files.