The Windows System File Checker (SFC) tool is a great tool for recovering corrupted files. Here’s a quick guide to recovering files and getting your computer back to normal operation.
Run SFC
First, you will need to open an elevated command prompt (CMD). Basically, you will need to run Command Prompt as administrator.
Open an elevated command prompt
Run search and enter command line. Find Command Prompt in the results, right-click it and select Run as Administrator.
Run DISM (Windows 8 and later)
Windows 8, Windows 8.1, and Windows 10 users will need to run the Deployment Image Servicing and Management (DISM) tool before running SFC.
Note . Windows 7 users can proceed to the next step.
At the command prompt, type the following command and hit enter:
– / DISM.EXE / ONLINE / CLEANUP-IMAGE / RESTORE HEALTH
DISM will use Windows Update to find files that will replace or repair damaged versions. This process can take several minutes.
Run Scannow
We can now scan the system for corrupted files. At the command prompt, enter the command:
SFC / SCANNOW
With this command Windows will scan your files and replace corrupted files. The scan will take some time. It is important that you do not close the command line until the scan is 100% complete.
Review the results
After the scan completes, you will receive one of the following messages:
- Windows Resource Protection found no integrity violations – Windows was unable to find corrupted files on your hard drive.
- Windows Resource Protection cannot perform the requested operation, which means you need to run the System File Checker in Safe Mode.
- Windows Resource Protection found corrupted files and successfully repaired them – Windows found corrupted files and fixed them
- Windows Resource Protection found corrupted files, but could not fix some of them – Windows found corrupted files, but couldn’t do anything about it.
View SFC details
You can open the sfcdetails.txt file to view or copy the scanned information. Use the instructions below to find the above text file.
Open an elevated command prompt and enter the following command:
FINDSTR / C: “[SR]”% WINDIR% LOGS CBS CBS.LOG “% USERPROFILE% DESKTOP SFCDETAILS.TXT”
This will create a copy of the file on your desktop. Open the file and view the results. Note that the file will display all data, including those collected from previous SFC runs.
You will need to check the time and date to find specific entries.
Manually replace damaged files
If SFC fails to replace the corrupted Windows file, you can try doing it manually. This is possible if you know where the damaged file is. You will also need a good copy of this file so that you can replace it.
Open an elevated command prompt and enter the following command:
TAKEOWN / F
Don’t forget to replace with the path to the damaged file. This command will allow you to take ownership of the infected file. CMD will inform you if the takeover is successful.
When finished, give administrators access to the corrupted file. Do this by typing the following command:
ICACLS / GRANT ADMINISTRATORS: F
Again, don’t forget to replace with the damaged file path.
Now you can replace the bad file with the good version. You will need to copy the good file and paste it over the old one. Enter the following command:
COPY
Replace with the location of the good copy file and replace with the path to the corrupted version.
–
Comment on “Use These Command Prompt Commands to Fix or Repair Corrupt Files”