This guide shows you how to locate the full scan history of Windows Defender (Microsoft Defender Antivirus) and permanently remove those records from your system. You’ll learn where the history is stored, how to clear it using built-in tools, and what to do if the usual methods don’t work. No third-party software is needed.
What You’ll Need
- A Windows 10 PC with administrator access (you must be able to approve User Account Control prompts).
- Knowledge of whether your system is running the classic Windows Security app or the older Windows Defender interface (this guide covers both).
- Optional: a backup of your important files before making system changes, though deleting scan history is generally safe.
Step-by-Step
- Open Windows Security. Click the Start button, type Windows Security, and press Enter. Alternatively, go to Settings > Update & Security > Windows Security and click “Open Windows Security.”
- Go to the Protection History area. In the Windows Security window, click on Virus & threat protection in the left sidebar. Then, under the “Current threats” section, click Protection history. This shows a list of recent detections and actions taken by Defender.
- Review the items listed. Each entry shows the threat name, the date/time, and the action taken (e.g., Quarantined, Removed). You can click an entry to see more details, including the affected file or app.
- Delete individual history entries. To remove a single entry, click the arrow next to it to expand the details, then click the Remove button that appears. Confirm if prompted. This deletes that specific record from the history list.
- Clear the entire history (if needed). Windows Security does not offer a “Clear all” button for protection history. To remove all entries at once, you need to use an elevated Command Prompt or PowerShell. Right-click the Start button, select Windows PowerShell (Admin) or Command Prompt (Admin), and click Yes on the UAC prompt.
- Run the command to delete history. In the elevated window, type the following command and press Enter:
del /q /f /s "%ProgramData%\Microsoft\Windows Defender\Scans\History\Service\DetectionHistory\*"
This permanently deletes all files in the detection history folder. You may see a “file not found” error if the folder is empty—that’s fine. - Also clear the scan history cache (optional). Some scan records are stored in the same folder as above, but you can also clear the entire Scans folder by running:
del /q /f /s "%ProgramData%\Microsoft\Windows Defender\Scans\History\*"
This removes all history, including scan results and detection records. Be aware this also clears any quarantine logs, but the quarantined files themselves remain in the quarantine folder. - Restart the Windows Security service (if the history still shows). If the entries persist after deletion, restart the Defender service. In the same elevated window, run:
net stop WinDefend
thennet start WinDefend
This forces Defender to reload its history from disk. - Verify the history is cleared. Go back to Windows Security > Virus & threat protection > Protection history. The list should now be empty or show only new detections that occurred after the deletion.
- If you’re using the older Windows Defender interface (pre-1809): Open Windows Defender by searching for “Windows Defender” in Start. Click the History tab, then select “View detailed results” and click Clear history. This button is only available in older builds; in current Windows 10 versions, the interface is the Windows Security app described above.
Common Mistakes
- Not running the command as administrator. If you don’t use an elevated prompt, you’ll get “Access denied” errors. Always right-click and choose “Run as administrator.”
- Deleting the wrong folder. The path uses
%ProgramData%which expands toC:\ProgramData. Do not type the literal%ProgramData%in File Explorer—use the variable in the command prompt, or navigate to the full path manually. - Expecting a “Clear all” button. Windows Security intentionally does not provide a one-click clear for protection history. You must use the command-line method to remove everything.
- Confusing scan history with quarantine. Deleting the history folder does not remove quarantined files. To delete quarantined items, go to Protection history, click each item, and choose “Remove” or “Restore.”
- Skipping the service restart. Sometimes the history list is cached in memory, so even after deleting files, the entries remain until you restart the WinDefend service or reboot the PC.
Tips
- Use the command with care. The
/sflag deletes all files in subfolders, so double-check the path before running. It’s safe for the Defender history, but don’t use it on other folders. - Create a restore point first. If you’re uncomfortable with command-line operations, create a system restore point before proceeding. That way you can revert if anything goes wrong.
- Check for Group Policy restrictions. On managed (corporate) PCs, your IT department may prevent you from clearing history. If the command fails with access denied, contact your administrator.
- Use the Windows Security app for normal viewing. For day-to-day checks, just open the Protection history page. Only use the command line when you need to purge everything.
- Consider disabling history collection (not recommended). You can turn off some Defender logging via Group Policy, but this weakens your ability to review past threats. Better to just clear the history periodically.
Troubleshooting
Problem: The command says “Access denied” or “The system cannot find the file specified.”
First, make sure you’re running the prompt as administrator. If you still get errors, the folder might not exist because Defender hasn’t run any scans yet, or the path is different on your system. Try navigating to C:\ProgramData\Microsoft\Windows Defender\Scans\History in File Explorer (enable hidden files). If the folder is missing, there’s nothing to delete—your history is empty.
Problem: After deletion, the history still shows old entries.
Restart the WinDefend service as described in Step 8. If that doesn’t work, reboot the PC. The entries may be cached in memory. If they still appear, check if you have another antivirus product that is also logging detections—Windows Security might be showing combined history.
Problem: The “Remove” button is greyed out for a specific entry.
This can happen if the threat is still active or if the item is protected by system permissions. Try running a full scan first, then attempt to remove the entry again. If it remains, the file may be in quarantine—go to Virus & threat protection > Protection history, click the item, and choose “Remove” to delete the quarantine copy.
Problem: I can’t find the Protection history section.
In older Windows 10 builds (before version 1809), the interface was different. Open Windows Defender, go to the “History” tab, and click “View detailed results.” If you have a newer build, ensure you’re looking under “Virus & threat protection” and not “Device security.”
Problem: The command deletes the history but also removes something important.
The command only targets the Defender history folder. It does not affect system files or your personal data. However, if you accidentally typed the wrong path, you could cause damage. Always copy the exact command from this guide.
Frequently Asked Questions
Q: Does deleting scan history affect future scans?
No. Deleting the history only removes the log of past scans and detections. It does not disable Defender or change how future scans run.
Q: Can I delete scan history from the Windows Security app without using commands?
You can delete individual entries by expanding them and clicking “Remove.” There is no built-in “Clear all” button. For a full wipe, you need the command-line method.
Q: Will this also delete quarantined files?
No. Quarantined files are stored separately. To delete them, go to Protection history, click each quarantined item, and choose “Remove.”
Q: Is it safe to delete the entire Scans\History folder?
Yes, it’s safe. Windows Defender will recreate the folder as needed. You’re only removing log files, not program components.
Q: Why would I want to clear the scan history?
Some users prefer to remove traces of what was scanned, especially on shared computers. It can also help if the history list is cluttered with old entries.
Q: Do I need to turn off real-time protection to delete history?
No. You can delete history while real-time protection is running. However, if a threat is currently being detected, the entry may reappear after deletion.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- How to Record Audio on Mac or PC
- Install LibreOffice 5 on Ubuntu: Step-by-Step
- Ways to Open Task Manager in Windows 11
- How to Fix a Slow and Lagging Windows 10 System
- Fix Dual Boot Option Not Showing on Windows
- Using Third-Party Navigation Apps on iPhone