How to prevent your antivirus from deleting files

Many antivirus software programs automatically delete suspicious files during security scans. While these antivirus tools can recover deleted files, they will most likely delete the file again during subsequent scans. To avoid recurrence, configure your antivirus program to exclude important files when scanning for viruses and malware.

We’ll show you how to prevent your antivirus program from automatically deleting files without your permission. This tutorial covers steps for Windows Defender and Popular third-party antivirus software—Avast, AVG, BitDefender, etc.

Before proceeding, make sure the file(s) are safe and not harm your PC and data before exempting it from antivirus scans. Ruling out the removal of a (harmful) file can make your PC more vulnerable to malware attacks and other threats.

Remark: The troubleshooting steps in this tutorial apply to Windows 10, Windows 11, and Mac or (macOS) devices.

Prevent Avast Antivirus from Deleting Files

Follow the steps below to prevent Avast from deleting a file, folder, or app when you scan your PC for threats.

  1. Start the Avast, select the hamburger menu icon in the top left corner and select Settings
  1. In the General section, select Exceptions in the sidebar and select the Add exception knob.
  1. Select To leaf through
  1. Check the box next to the item (file, folder, app, etc.) you want to exclude from Avast scans and select Okay
  1. Select the Add exception button to continue.

This prevents Avast from deleting the selected files during all security scans. Avast also allows you to exclude items from a specific type of scan. See the next step for detailed instructions.

  1. Go to Avast’s Exceptions menu (see step #3) and select Add advanced exceptions
  1. Go to the File directory tab and select To leaf through to choose the files/folder you want to exclude. Then check the box next to the scan types and select Add exception

After this, Avast will skip the files during the selected security scans. Avast also lists all exempt items in the “File or Folder” section. To remove an exclusion, hover your cursor over the item and select the Bin icon. Otherwise, select the pen icon to edit the exclusion.

Prevent AVG from deleting files

AVG is also security software from Avast. The process to prevent AVG from automatically deleting files is similar to Avast’s.

  1. Start AVG, select the hamburger menu icon in the top right corner and select Settings
  1. Go to the General tab, select Exceptions in the sidebar and select Add exception
  1. Select To leaf through
  1. Check the box next to the files or folder(s) you want to exclude from malware scans and select Okay
  1. Select Add exception continue.

To remove a file from the list of exceptions, place the cursor on the item in the “File or Folder” section and select the Bin icon.

Prevent BitDefender from deleting files

If BitDefender is the default antivirus solution on your computer, here’s how to prevent the app from deleting a file when scanning for threats.

  1. Open BitDefender, go to the Protection tab (in the sidebar) and select Settings in the “Online Threat Prevention” section.
  1. Select Manage exceptions in the “Exceptions” row.
  1. Select Add an exception on the next page.
  1. Select the folder icon with a magnifying glass in the search box.
  1. Select the file or folder from which you want to prevent the antivirus from being removed and select Okay
  1. In the “Protection Feature” section, enable Antivirus. After that, check the box next to the scan types. BitDefender does not scan the exempt items when you run the selected scans. Select Save continue.

Go to the “All Exceptions” tab to preview the exempted files. Select the baking icon to delete a file or select the pen icon to change the exception options.

Prevent Windows Defender from deleting files

Windows Defender also allows you to exclude items – files, file types, processes, folders, etc. – from security checks. In this section, we’ll show you how to configure Windows security settings so that your PC doesn’t automatically delete files it suspects are malicious.

  1. On a Windows 11 computer, go to SettingsPrivacy and SecurityWindows Security

For Windows 10 go to SettingsUpdate & Security and select Windows Security

  1. Select Virus & Threat Protection in the “Protected Areas” section. That will launch the Windows Security app.
  1. Scroll to the “Virus & threat protection settings” section and select Manage settings to open the Windows Defender settings menu.
  1. Scroll to the ‘Exclusions’ section and select Add or remove exclusions
  1. Select the Add an exclusion knob.
  1. Select File from the options because you are trying to prevent Windows Security (or Windows Defender) from deleting a specific file type.
  1. Navigate to the folder or destination where the file is located on your computer and select the file you want to prevent Windows Defender or Windows Security from being removed. Select Open Get on.
  1. To prevent Windows Defender from deleting a particular file type or extension, select: File type from the drop-down menu and enter the extension in the box.

Remark: You can enter the file extension with or without the preceding period (.). Supposing you want to prevent Windows Security from marking or deleting DLL files, you can enter the file type/extension as dll or .dll† For executable files (or exe files), type exe or .exe in the dialog box.

  1. Select To add to include the file type in the Windows Defender exclusion list.
  1. To exclude a specific process, return to the “Exclusions” menu (see step #4), select the Add an exclusion button, and select Process
  1. Enter the process name and select To add

Quick Tip: Start Task Manager and go to the Details tab to list all the processes running on your Windows computer. Check the “Name” column for the name of each process.

When you exclude a process in Windows security settings, files opened by that particular process are also excluded during real-time protection. However, the files of the process are not exempted during on-demand and scheduled scans.

You’ll find excluded files, folders, file types, processes, and other items on the Windows Security Exclusions page, right below the “Add an exclusion” button.

To remove an item from the list, select the file/file type/process and select remove

You should disable Windows Defender and use third-party antivirus programs if Windows Security continues to delete your files.

One more thing: Disable Storage Sense in Windows

Storage Sense is not an antivirus program. It’s a feature in Windows that frees up disk space by automatically deleting files you haven’t used in the last 30 days. If your PC often deletes files and your antivirus is not the culprit, consider disabling Storage Sense.

Remark: Storage Sense does not delete items in the Downloads folder or items stored by cloud storage services such as OneDrive.

Go to SettingsSystemStorage and switch off Storage sense in the “Storage Manager” section.

There are hundreds of antivirus software available. If you are not using any of the apps mentioned above, contact the developer or check the developer’s website to find out how to prevent those antivirus from deleting files when scanning for malware.

Losing important files can be terrible. If your antivirus program deleted a file that you didn’t add to the exception list, you can always get the file back with data recovery software.

Leave a Reply

Your email address will not be published.