For damaged Windows files, open Command Prompt as administrator, run DISM /Online /Cleanup-Image /RestoreHealth, then sfc /scannow, and restart. For a single document or photo that won’t open, restore an earlier copy with File History or Previous Versions (or OneDrive’s version history), and check the drive with chkdsk if errors keep coming back.
The steps below are for Windows 10 version 22H2 and use only tools built into Windows.
First, work out which kind of corruption you have
“Corrupted files” covers three different problems, and each has its own fix. Picking the right one saves time and avoids risky steps.
| What you see | Likely problem | Where to start |
|---|---|---|
| Windows features misbehave, Settings or the Start menu won’t open, system errors, freezes | Damaged Windows system files | DISM, then SFC |
| One Word file, spreadsheet, photo or video won’t open or shows garbage, while everything else is fine | A damaged personal file | Restore an earlier copy |
| Many files on one drive fail, “The file or directory is corrupted and unreadable”, files vanish, the drive is slow or clicks | File system errors or a failing drive | Back up first, then chkdsk |
Two rules apply to every case. First, copy any important file you are about to work on to another drive or to the cloud, so a failed repair can’t make things worse. Second, never delete files from the Windows, Program Files or ProgramData folders to “remove corruption”: Windows needs them, and SFC is the tool that replaces them safely.
Windows 10 reached end of support on October 14, 2025, so it no longer gets regular security fixes without Extended Security Updates. These repair tools still work the same way.
Repair Windows system files with DISM and SFC
Microsoft recommends running DISM before System File Checker. DISM (Deployment Image Servicing and Management) repairs the Windows component store, which is the stash of clean files that SFC copies from. If that store is damaged, SFC has nothing good to copy, so fixing it first gives SFC the best chance.
- Select Start, type cmd, right-click Command Prompt in the results and choose Run as administrator. Select Yes (or enter an administrator password) when asked.
- Type DISM.exe /Online /Cleanup-image /Restorehealth and press Enter. Microsoft says this can take several minutes. Let it finish.
- When DISM reports that the operation completed, type sfc /scannow and press Enter.
- Leave the window open until verification reaches 100 percent. Microsoft warns not to close Command Prompt before then.
- Read the result message (explained below), then restart the PC.
DISM downloads the clean files it needs from Windows Update, so stay connected to the internet while it runs. If Windows Update itself is broken, Microsoft documents pointing DISM at another source, such as the Windows folder from Windows 10 installation media you created with Microsoft’s own tool, using the /Source and /LimitAccess options on the System File Checker page. The SFC command on its own is covered step by step in running an SFC scan on Windows 10.
What the SFC result means
- “Windows Resource Protection did not find any integrity violations.” Your system files are fine. If something is still wrong, the cause is elsewhere: a damaged personal file, a driver, an app or the drive.
- “Windows Resource Protection found corrupt files and successfully repaired them.” The fix worked. Restart and check whether the problem is gone.
- “Windows Resource Protection found corrupt files but was unable to fix some of them.” Run DISM and SFC once more after a restart; a second pass sometimes clears what the first could not. If it still fails, see the next section.
- “Windows Resource Protection could not perform the requested operation.” Microsoft’s advice is to run the SFC scan in Safe Mode.
When SFC can’t fix everything
SFC writes its details to a log called CBS.log. To pull out only the SFC lines into a file on your desktop, run this in an administrator Command Prompt:
findstr /c:”[SR]” %windir%\Logs\CBS\CBS.log >”%userprofile%\Desktop\sfcdetails.txt”
Open sfcdetails.txt and look at the newest date and time entries. Lines that say “Cannot repair member file” name the files SFC couldn’t fix. Microsoft does describe replacing such a file by hand with a known good copy, but that involves taking ownership of protected system files and is easy to get wrong. For most people the safer next step is Reset this PC with Keep my files (covered below), which reinstalls Windows while leaving your documents in place.
Restore a damaged document or photo
A personal file that won’t open is rarely fixed by SFC, because SFC only checks Windows’ own files. The reliable fix is an earlier, undamaged copy. Try these in order.
Restore previous versions (File History)
This works if File History was turned on before the file was damaged and has been saving to an external drive or network location.
- Connect the File History drive if it is an external one.
- Open File Explorer and go to the folder that contains the damaged file.
- Right-click the file (or the folder that holds it) and choose Restore previous versions. The Previous Versions tab lists the saved copies.
- Pick a version from before the problem started. To check it first, expand Open and choose Open in File History.
- To keep the damaged file as well, expand Restore and choose Restore to…, then pick another folder. Selecting Restore on its own replaces the current file, and Microsoft warns that this can’t be undone.
If the list is empty, File History wasn’t backing up that location. Turn it on now in Control Panel > System and Security > Save backup copies of your files with File History so the next problem has a copy waiting. File History covers your libraries (Documents, Pictures, Videos, Music) and the Desktop by default.
OneDrive version history
If the file lives in your OneDrive folder, OneDrive keeps earlier versions for 30 days, for every file type.
- In File Explorer, right-click the file in your OneDrive folder and choose Version history. (Or sign in at onedrive.com, select the file and choose Version history there.)
- Select the three dots next to a version from before the damage and choose Restore.
The app’s own recovery options
Many programs keep their own backups. Microsoft Office apps, for example, can show earlier versions and unsaved drafts from the File menu, and photo editors often keep the original image next to the edited copy. If you deleted the file or lost it entirely rather than finding it damaged, recovering deleted files in Windows 10 from backups first walks through File History, OneDrive and Microsoft’s Windows File Recovery tool.
A word of caution about “file repair” programs and upload-your-file repair websites: they can’t recreate data that is gone, and an online service means handing a private file to a stranger. An earlier copy is always the better route.
Check the drive with chkdsk
If errors keep returning, many files are affected or Windows reports a file as “corrupted and unreadable”, the drive’s file system may be damaged. Check Disk (chkdsk) finds and fixes those errors.
Back up first. If the drive is making clicking or grinding noises, or files are disappearing, copy everything important to another drive before you run any repair. Repairs put extra work on a failing drive, and chkdsk may discard data it can’t make sense of rather than save it.
- Open Command Prompt as administrator (as in the DISM steps).
- For a quick online check of the system drive, type chkdsk C: /scan and press Enter. This runs while Windows is in use and reports whether problems were found.
- To fix errors, type chkdsk C: /f. Because Windows is using drive C, chkdsk asks whether to check the drive the next time the system restarts. Type Y, press Enter and restart. The check runs before Windows loads, and the PC restarts again on its own when it finishes.
- For a second drive such as D:, use chkdsk D: /f. Close any files open on that drive first. If chkdsk can lock the drive it runs straight away; if not, it offers to check it at the next restart.
/f or /r?
/f fixes file system errors. /r does everything /f does and also scans every sector for physical damage, recovering what it can read. That surface scan can take hours on a large hard drive, and on the system drive the PC is unusable meanwhile, so start with /f and use /r only when you suspect bad sectors (for example, files that fail to copy at the same spot every time). Plug a laptop into power before either one.
If chkdsk reports bad sectors, or problems return within days, treat the drive as failing: copy your files off and plan a replacement. Repairing the file system on a drive that is physically wearing out only buys time.
Removing a file that is corrupted beyond repair
Sometimes a personal file is simply ruined and you want it gone, but Windows refuses to delete it. Work through these in order, and only for your own files in folders such as Documents, Downloads, Desktop or a data drive.
- Close the app that last opened it, then try again. If it still says the file is in use, restart the PC and delete it before opening anything else.
- Run chkdsk /f on that drive (above). A file that is “corrupted and unreadable” often becomes deletable once the file system errors are fixed.
- Still stuck? Start Windows in Safe Mode, where fewer programs run, and delete it there: go to Settings > Update & Security > Recovery, select Restart now under Advanced startup, then choose Troubleshoot > Advanced options > Startup Settings > Restart and press 4 for Enable Safe Mode.
Avoid “unlocker” or “force delete” utilities. They work by overriding Windows’ file locks, and pointed at the wrong file they can break Windows or an installed app. The same goes for running delete commands on files inside system folders: SFC and DISM are the correct way to deal with damaged Windows files. The same task on a newer PC is covered in deleting corrupted files in Windows 11.
Last resort: Reset this PC with Keep my files
If DISM and SFC can’t repair Windows and the problems make the PC hard to use, resetting reinstalls Windows. Before you start, back up your important files to an external drive or OneDrive, and if the drive is encrypted with BitLocker, make sure you have the recovery key.
- Select Start > Settings > Update & Security > Recovery.
- Under Reset this PC, select Get started.
- Choose Keep my files. It reinstalls Windows and removes apps and settings, but keeps documents, photos and other personal data. (Remove everything erases your files too.)
- Choose Cloud download (a fresh copy of Windows from Microsoft, useful when local files are corrupted) or Local reinstall, then follow the prompts.
The screen may stay black for a long time (Microsoft mentions upwards of 15 minutes) and the PC may restart itself. Don’t restart it manually during the reset. Afterward, reinstall your apps from their original sources.
chkdsk restarts, malware and preventing corruption
Why did the PC restart twice after I scheduled chkdsk?
That is expected. When chkdsk checks the drive Windows starts from, it runs before Windows loads, corrects errors automatically and then restarts the computer again by itself. On a big, busy drive the check can take a long time, so start it when you can leave the PC alone.
Can antivirus software cause or fix corruption?
Malware can damage files, so a full scan with Windows Security is worth running if corruption appeared suddenly along with other odd behavior. Restore damaged personal files from a backup afterward; a scan removes threats but doesn’t rebuild what they broke.
What prevents this from happening again?
- Shut down from the Start menu rather than holding the power button, and don’t unplug USB drives while files are copying.
- Keep File History or OneDrive running so every important file has an earlier copy.
- Run chkdsk /scan now and then, and act on any warning about the drive.
- Install Windows and driver updates through Windows Update.
Start with the DISM and SFC pair if Windows itself is acting up, or with Restore previous versions if one file is the problem, and turn on File History today so the next repair is a simple restore.
Matthew Simpson has been creating online tutorial for computers and smartphones since 2010. His work has been read millions of times and helped people to solve a number of various tech problems. His specialties include Windows, iPhones, and Google apps.