Windows Defender Keeps Deleting My File: Causes and Fixes

When Windows Defender keeps deleting a file, it has usually flagged it as a threat and quarantined it. Here is how to judge whether it is safe, restore it, and stop the repeat deletions.

Windows Security's Virus & threat protection page with the Protection history link circled in red and a cursor on it.
In this article

Windows Defender removes any file it detects as a threat, and that includes videos, documents and downloaded .exe programs. If your file keeps disappearing, Defender has most likely flagged it again each time it shows up. [1]

The deletion can repeat after a reboot, and it can even continue after reinstalling Windows. [1][2] That is why deleting and re-downloading the file rarely helps. In one case, a large archive downloaded in Edge was removed the moment the download finished. [3]

The quick path has three steps: judge whether the file is safe, restore it from Protection history, and add an exclusion only if you trust it. This article walks through each step in that order.

What makes Defender flag a file you trust?

Defender flags a file for one of two reasons: it really is malicious, or it only looks suspicious to Defender’s detection (a false positive). Both end the same way, with the file removed, so the deletion alone tells you nothing about which one you have. The other sections cover how to judge it.

Downloads that vanish right away

Downloaded archives and .exe files are the most common victims. One user reported downloading a large archive in Edge and watching it get deleted the moment the download finished, with a “virus detected” message. [3] Another source lists downloaded .exe programs, along with videos and documents, among the files Defender removes. [1]

Executable files that Defender marks are quarantined and deleted from your system. [1] That is why a fresh installer can disappear before you ever open it.

Rule out Windows 10 storage features

On Windows 10, Defender is not the only possible cause. Reports say Windows 10 can keep deleting programs and documents, even after a reboot, because of Defender or the newer storage sense feature (the source calls it a “memory sensor”). [1] If a file keeps disappearing and Defender’s Protection history shows nothing for it, a storage feature is a reasonable suspect.

Reinstalling Windows will not help

A clean reinstall does not change how Defender treats the same file. If Defender keeps deleting files after you reinstall Windows, the advice is to exclude the affected folders from scanning. [2] The file itself is what triggers the detection, so it will be flagged again unless you deal with it directly.

Close-up of a person's hands typing on a laptop while a downloaded file sits in the browser's download bar.

How do you tell if it is a false positive?

Start with what Defender tells you about the file, then judge where it came from. A real threat and a false positive can look the same at first, so the details matter.

Read the threat name and details

Open Windows Security, go to Virus & threat protection, and open Protection history. Select the entry for your file to see the threat name, the item affected and the action Defender took. The same history lists quarantined threats, and it is where you would later restore a file. [4]

A specific name tells you more than a vague one. If the entry names a threat that has nothing to do with what the file claims to be (a “video” flagged as a trojan, say), treat that as a warning sign rather than a mistake.

Think about where the file came from

Ask yourself how the file reached your PC. One user reported that a large archive downloaded in Edge was deleted the moment the download finished, with a message that a virus was detected. [3]

If you got a file from the software publisher’s own site, or from a coworker who built it, you have a reason to trust it. If it came from a random link, a pirated copy, or an email attachment you did not expect, you do not.

If you are unsure, leave it alone

When you cannot say with confidence that the file is safe, do not restore it and do not exclude it. Leaving it quarantined costs you very little. Getting it wrong can cost you much more.

Safety

Restoring or excluding a real threat can expose your PC and your data, because Defender will no longer stop it. Back up important files first, and restore or exclude only files you got from a publisher or person you trust.

How do you restore a file Defender removed?

You can restore a file Defender removed from Protection history in Windows Security, as long as it was quarantined rather than permanently deleted.

  1. Open Windows Security from the Start menu.

  2. Select Virus & threat protection.

  3. Find the threat history link and open it. In the older Windows Defender Security Center, this was labeled Threat history; under Quarantined threats you click See full history. [4]

  4. Select the file you want back in the list. [4]

  5. Click Restore. [4]

The file returns to its original location. If Defender flags it again, that is a separate step covered under exclusions.

Windows 10 and 11 menus

The menu wording differs slightly between versions. The older steps above use the names “Threat history” and “See full history” [4], while newer Windows builds label the page Protection history under Virus & threat protection. Look for the same list of past detections and the Restore option on the selected item.

If nothing is listed to restore

When the file is not in the list, it may have been permanently deleted. You can often still recover permanently deleted files, but you should stop using the device right away, because new data can overwrite the old files and make them unrecoverable. [4]

Other recovery routes include rolling the system back to a restore point. [4] A dedicated recovery tool is another option for files Defender deleted. [5]

How do you stop Defender deleting it again?

Exclude only the specific file or folder Defender keeps removing, never a whole drive, and do it after you have restored the file. If Defender keeps deleting files even after reinstalling Windows, excluding the affected folders from scanning is the fix to try. [2]

In Windows Security, the exclusion goes under Virus & threat protection settings, and the order and scope below matter most. For more detail, see How to Add a File Exclusion in Windows Security.

  1. Restore the file first. Bring it back from Protection history, as described above. An exclusion added before the restore does not undo the earlier deletion.

  2. Pick the narrowest target. If one downloaded installer is the problem, exclude that file. If a program keeps losing files from its own install folder, exclude that folder. Excluding something like C:\ removes protection from everything on the drive, including files you have not yet downloaded.

  3. Add the exclusion in Windows Security. Under Virus & threat protection settings, add it to the exclusion list.

  4. Retry the action that triggered the deletion. Run the installer again or copy the file back. If the file stays put, the exclusion is working.

  5. Review the list later. Once you no longer need the program or file, remove its exclusion so Defender scans that location again. A good time is after you finish the project or uninstall the software.

A short example: a small business owner’s accounting tool keeps vanishing from C:\Tools\Ledger. They restore it, exclude only that Ledger folder, reinstall, and later remove the exclusion when they switch to different software. For a closer look, read How to Remove an Exclusion From Windows Defender.

When should you get more help?

Get more help when Defender’s behavior stops looking like a one-time mistake. Restoring a file and excluding it works for a single trusted item. It is the wrong tool when the pattern keeps repeating or you cannot tell what is going on.

The same file returns, or other files keep being flagged

If a file reappears after you remove it, or new files keep getting flagged, something may be putting them there again. A trusted installer you rerun is one example. Another is a program that keeps downloading its own components. Stop and find the source before you restore or exclude anything.

A full scan is a reasonable next step here. It checks the whole system instead of the one file Defender caught. The software’s publisher can also tell you whether its files are known to trigger antivirus warnings.

Defender reports a serious threat you cannot identify

If the threat name in Protection history means nothing to you, do not restore the file. Restoring is a manual action in Windows Security: Virus & threat protection, then threat history, then See full history under Quarantined threats, then Restore. [4] Because that path puts the file back, use it only for files you recognize and trust.

If the file is already gone and you want it back, stop using the device right away. Continued use can overwrite the data, and then it cannot be recovered. [4]

Who to ask

  • The software’s publisher: for a program you installed and trust, their support can explain the detection.

  • A full Defender scan: for repeat detections or unfamiliar threats.

  • An IT professional: for a work PC or a threat you cannot explain.

Quick questions about Defender deletions

Does Defender delete files automatically?

Yes, it can. Defender removes or quarantines files it detects as threats, and a false positive gets the same treatment as a real threat. If a trusted file keeps vanishing, the cause is usually a detection rather than a glitch in Windows.

Where are quarantined files stored?

Quarantined files are held in Windows Security’s quarantine area, not in their original folder. You reach them through the threat history, not through File Explorer. The path is:

Virus & threat protection > Threat history > See full history under Quarantined threats [4]

Select the file you want back and click Restore. [4] Only restore files you trust.

Can I recover a permanently deleted file?

Often you can. Permanently deleted files can still be returned, but only if the data has not been overwritten. [4]

That is why you should stop using the device right away. New data written to the drive can overwrite the deleted file, and then it is gone for good. [4]

If nothing appears in the quarantine list, a file recovery tool is the next option. Such tools exist for Windows, and some are marketed specifically for recovering files removed by Defender. [5] Install one on a different drive from the one that held the file, so the installer does not write over the data you want back.

What to do next

Remember the order: verify the file, restore it from Protection history, and only then exclude it. Skipping the first step is what turns a nuisance into a risk, because a real threat you restore or exclude stays on your PC.

Your next step is to open Protection history and read the threat name for the file Defender removed. If you trust the source, restore it and exclude just that file or folder. Users report that excluding the affected folders is what stops repeat deletions, even after reinstalling Windows. [2] If a download vanishes the moment it finishes, as happened with a large archive from Edge, the same check applies before you restore it. [3]

Sources

  1. Do you have the same problem as Windows Defender that keeps deleting files such as videos…

  2. Windows Defender deleting installed software?

  3. Windows Defender deleted my download without permission

  4. 1 How can I recover my deleted files from virus?

  5. How to Recover Files Deleted By Windows Defender?