To prevent file corruption, protect files while they are being written and keep more than one copy. In practice that means: always eject USB drives and memory cards before unplugging them, never cut the power or close the laptop while something is saving, keep your drives healthy and Windows up to date, avoid editing the same file in two places at once, and back up automatically with File History, OneDrive or an external drive. No habit makes corruption impossible, but together they make it rare, and backups make it harmless when it does happen.
Here is why each habit matters and how to set it up on Windows 10 and 11.
Why files get corrupted in the first place
Most corruption happens at one of two moments: while a file is being written, or while it is sitting on storage that is starting to fail. A file that is half-saved when the power goes out, a memory card pulled out during a copy, a camera that shuts down mid-recording, or a hard drive developing bad sectors all leave files that no longer match their expected structure.
A smaller number of cases come from software crashes, sync conflicts, malware, and transfers that silently stop partway. For a full rundown, see what causes files to become corrupted. The prevention steps below target each of these causes.
Everyday habits that prevent corruption
Eject before you unplug
Windows can hold data in memory and finish writing it to a USB drive a moment later. Click the Safely Remove Hardware and Eject Media icon in the taskbar, or right-click the drive in File Explorer and choose Eject, and wait for the confirmation. This matters most for memory cards and USB sticks used with cameras, phones and other PCs.
Let saves and copies finish
Wait for Word, Excel or a photo editor to finish saving before you close the lid, and do not shut down while a large copy is still running. If an app is frozen, give it a minute before force-closing it. For long copies, the built-in robocopy command is more forgiving than drag and drop because it retries and can resume interrupted files.
Shut down properly
Holding down the power button skips the normal shutdown that flushes files to disk. Use Start > Power. If you lose power often, a small uninterruptible power supply (UPS) for a desktop PC gives Windows time to close properly.
Keep camera batteries and cards healthy
Videos are especially vulnerable because the camera writes the file's index at the end of the recording. If the battery dies or the card fills up, the video is left without it. Charge before long shoots, keep spare cards, format cards in the camera rather than on the PC, and stop recording before swapping batteries. See fixing video cut off when the battery died if it has already happened.
Avoid sync conflicts
Do not open the same Office file on two devices at once unless you are using co-authoring through OneDrive or SharePoint. Do not keep working files inside folders synced by two different services. Let OneDrive finish syncing before you shut down or go offline.
Keep your drives and PC healthy
A failing drive corrupts files slowly and quietly, so it pays to check now and then.
- Check drive health. On Windows 11, open Settings > System > Storage > Advanced storage settings > Disks & volumes, select a drive and choose Properties; NVMe SSDs show a drive health section with estimated remaining life. On either version, the PowerShell command
Get-PhysicalDiskshows a HealthStatus for each drive. - Scan for file system errors. Right-click a drive in File Explorer, choose Properties > Tools > Check. Windows will tell you if it finds problems.
- Replace drives that show warnings. Clicking noises, very slow copies, or files that suddenly will not open are all reasons to copy your data off and replace the drive.
- Leave free space. A nearly full drive makes interrupted saves more likely. Keep some space free, especially on the system drive.
- Keep Windows, Office and drivers updated, and keep Microsoft Defender or your security software running, since some malware damages or encrypts files.
Back up: the real protection
Good habits cut the risk; backups remove the consequences. A common rule is 3-2-1: three copies of important files, on two different types of storage, with one copy kept off-site or in the cloud.
| Option | What it protects | How to set it up |
|---|---|---|
| File History | Keeps older versions of files in your user folders on an external or network drive | Control Panel > File History, choose a drive and turn it on |
| OneDrive folder backup | Desktop, Documents and Pictures, with version history for each file | OneDrive settings > Sync and backup > Manage back up |
| Copy to an external drive | Anything you choose, including other drives and large media folders | Copy manually or schedule robocopy with Task Scheduler |
| Office AutoSave and AutoRecover | Unsaved work after a crash in Word, Excel and PowerPoint | File > Options > Save; AutoSave works for files stored in OneDrive or SharePoint |
Version history is what makes a backup useful against corruption. If a file was damaged on Tuesday and synced, a backup that only holds the latest copy holds the damaged one. File History and OneDrive both keep earlier versions you can go back to: right-click a file and choose Properties > Previous Versions, or Version history in OneDrive.
Test your backups occasionally by restoring a file and opening it. A backup you have never tested is a hope rather than a plan.
Check important files after big moves
After copying a photo library to a new drive, restoring from backup or recovering files from a failed disk, it is worth checking that the copies actually open. Opening thousands of files by hand is not realistic, which is where a quick check helps.
File Repairer's Tools > Check Files for Damage lets you drag in whole folders and marks each supported file as Damaged or No damage found, without changing anything. It covers Word, Excel and PowerPoint, PDF, JPEG, PNG, HEIC and camera RAW photos, MP4, MOV, AVI and MKV videos, and ZIP and RAR archives. Checking is free, and it runs entirely on your PC.
If something is flagged while the original is still available, simply copy it again. If the damaged file is the only copy, File Repairer can repair it and save a new copy with " (repaired)" in its name, leaving the original untouched. Saving repaired copies needs an Installation Key.
When prevention was too late
If a file is already damaged, do not keep saving over it or opening it in different programs. Make a copy and work on that. Check for a previous version first, then try the program's built-in repair, such as Word's or Excel's Open and Repair. Our guide to repairing corrupted files on Windows walks through the order to try things in.
And if the file was deleted or the drive will not show up at all, that is a job for data recovery software first. Repair comes afterwards, on the files you recovered.
Frequently asked questions
Does turning off a PC without shutting down corrupt files?
It can. Any file being written at that moment may be left incomplete, and Windows may not have finished saving data held in memory. Use Start > Power whenever you can.
Is a cloud backup enough to protect against corruption?
Only if it keeps earlier versions. A damaged file syncs like any other, so you need version history, such as OneDrive's, to go back to a good copy.
How often should I check my drive's health?
A quick look every few months is sensible, and immediately if copies slow down, the drive makes noises, or files suddenly fail to open.
