许多防病毒软件程序会在安全扫描期间自动删除可疑文件。尽管这些防病毒工具可让您恢复已删除的文件,但它们很可能会在后续扫描期间再次删除该文件。为防止再次发生,最好将您的防病毒软件配置为在扫描病毒和恶意软件时排除重要文件。
我们将向您展示如何防止您的防病毒软件在未经您批准的情况下自动删除文件。本教程将介绍Windows Defender和流行的第三方防病毒软件(third-party antivirus software)(Avast、AVG、BitDefender 等)的步骤。
在继续之前,请确认文件安全且不会损坏您的 PC 和数据,然后再将其从防病毒扫描中排除。排除(有害)文件不被删除可能会增加您的 PC 对恶意软件攻击和其他威胁的脆弱性。
注意:(Note:)本教程中的故障排除步骤适用于Windows 10、Windows 11 和Mac或 (macOS) 设备。
防止 Avast Antivirus(Prevent Avast Antivirus)删除文件
请按照以下步骤阻止Avast在扫描您的 PC 以查找威胁时删除文件、文件夹或应用程序。
- 启动 Avast,选择左上角的汉堡菜单图标,然后选择(hamburger menu icon)设置(Settings)。
- 在常规(General)部分中,选择侧栏上的例外,然后选择(Exceptions)添加例外(Add Exception)按钮。
- 选择浏览(Browse)。
- 选中您想要免除Avast扫描的项目(文件、文件夹、应用程序等)旁边的复选框,然后选择OK。
- 选择添加例外(Add Exception)按钮以继续。
这将阻止Avast在所有安全扫描期间删除选定的文件。Avast还允许您从特定类型的扫描中排除项目。有关详细说明,请参阅下一步。
- 前往 Avast 的Exceptions菜单(参见步骤 #3)并选择Add Advanced Exceptions。
- 前往File/Folder选项卡并选择浏览(Browse )以选择要排除的文件/文件夹。然后(Afterward),选中扫描类型旁边的框并选择添加例外(Add Exception)。
此后,Avast将在选定的安全扫描期间跳过文件。Avast还将在“文件或文件夹”部分列出所有豁免项目。要删除排除项,请将光标悬停在项目上并选择Bin图标。否则,请选择钢笔图标(Pen icon)以编辑排除项。
防止 AVG 删除文件
AVG也是 Avast 拥有的安全软件。防止AVG自动删除文件的过程与 Avast 的类似。
- 启动 AVG,选择右上角的汉堡菜单图标,然后选择(hamburger menu icon)Settings。
- 前往General选项卡,选择侧边栏上的Exceptions,然后选择Add Exception。
- 选择浏览(Browse)。
- 选中要从恶意软件扫描中排除的文件或文件夹旁边的复选框,然后选择确定(OK)。
- 选择添加例外(Add Exception)以继续。
要从例外列表中删除文件,请将光标悬停在“文件或文件夹”部分中的项目上,然后选择Bin图标。
防止 BitDefender(Prevent BitDefender)删除文件
如果BitDefender是您计算机上的默认防病毒解决方案,以下是如何防止应用程序在扫描威胁时删除文件。
- 打开 BitDefender,前往保护(Protection)选项卡(在侧边栏上),然后在“在线威胁防护”部分选择设置(Settings)。
- 在“例外”行中选择管理例外。(Manage exceptions)
- 在下一页上选择添加例外。(Add an Exception)
- 在搜索框中选择带有放大镜的文件夹图标。(folder icon with a magnifying glass)
- 选择要防止防病毒软件删除的文件或文件夹,然后选择确定(OK)。
- 在“保护功能”部分,打开防病毒(Antivirus)。然后(Afterward),选择扫描类型旁边的复选框。当您运行选定的扫描时, BitDefender(BitDefender)不会扫描豁免项目。选择保存(Save)继续。
前往“所有例外”选项卡以预览豁免文件。选择Bin 图标(Bin icon)删除文件或选择Pen 图标(Pen icon)修改例外选项。
防止Windows Defender删除文件
Windows Defender还允许您从安全检查中排除项目(文件、文件类型、进程、文件夹等)。在本节中,我们将向您展示如何配置Windows 安全(Windows Security)设置,以便您的 PC 不会自动删除它怀疑为恶意的文件。
- 在 Windows 11 计算机上,转到“设置”(Settings) > “隐私和安全(Privacy & security)” > “ Windows 安全(Windows Security)” 。
对于 Windows 10,前往设置(Settings)>更新和安全(Update & Security)并选择Windows 安全(Windows Security)。
- 在“保护(Protection)区域”部分中选择病毒和威胁保护。(Virus & threat protection)这将启动Windows 安全(Windows Security)应用程序。
- 滚动到“病毒和威胁防护设置”部分,然后选择管理设置(Manage settings)以打开Windows Defender设置菜单。
- 滚动到“排除项”部分,然后选择添加或删除排除项(Add or remove exclusions)。
- 选择添加排除(Add an exclusion)按钮。
- 从选项中选择File,因为您试图阻止Windows Security(或Windows Defender)删除特定文件类型。
- 导航到计算机上文件所在的文件夹或目标位置,然后选择要阻止Windows Defender或Windows 安全(Windows Security)中心删除的文件。选择打开(Open)以继续。
- 要阻止Windows Defender删除特定文件类型或扩展名,请在下拉菜单中选择文件类型,然后在框中输入扩展名。(File type)
注意:(Note:)您可以输入带有或不带有前一个句点 (.) 的文件扩展名。假设(Say)您想阻止Windows 安全(Windows Security)性标记或删除DLL文件,您可以将文件类型/扩展名输入为dll或.dll。对于可执行文件(executable files)(或 exe 文件),在对话框中键入exe或.exe 。
- 选择添加(Add)以将文件类型包括在 Windows Defender 的排除列表中。
- 要排除特定进程,请返回“排除”菜单(参见步骤 #4),选择“添加排除(Add an exclusion)”按钮,然后选择“进程(Process)” 。
- 输入进程名称并选择Add。
快速提示:(Quick Tip:) 启动任务管理器(Launch Task Manager)并转到详细信息(Details)选项卡以查看Windows计算机上运行的所有进程的列表。检查“名称”列以获取每个进程的名称。
当您在Windows 安全(Windows Security)设置中排除某个进程时,该特定进程打开的文件也将在实时保护期间被排除。但是,在按需扫描和计划扫描期间不会免除该进程的文件。
您可以在“ Windows 安全排除(Windows Security Exclusions)”页面中找到排除的文件、文件夹、文件类型、进程和其他项目——就在“添加排除”按钮的正下方。
要从列表中删除项目,请选择文件/文件类型/进程,然后选择删除(Remove)。
如果Windows 安全(Windows Security)中心不断删除您的文件,您应该禁用 Windows Defender(disable Windows Defender)并使用第三方防病毒程序。
还有一件事:在Windows中禁用存储感知(Windows)
Storage Sense不是防病毒软件。这是Windows(Windows)中的一项功能,可通过自动删除您在过去 30 天内未使用的文件来释放磁盘空间。(frees up disk space)如果您的 PC 经常删除文件,而您的防病毒程序不是罪魁祸首,请考虑禁用Storage Sense。
注意:(Note:) Storage Sense不会删除“下载”文件夹中的项目或由(Downloads)OneDrive等云存储服务保存的项目。
转到“设置”(Settings) > “系统(System)” > “存储(Storage)”,然后在“存储管理”部分中关闭“存储感知”。(Storage Sense)
那里有数百种防病毒软件。如果您不使用上述任何应用程序,请联系开发人员或查看开发人员的网站,了解如何防止防病毒软件在扫描恶意软件时删除文件。
丢失重要文件可能很糟糕。如果您的防病毒软件删除了您尚未添加到其例外列表中的文件,您始终可以使用数据恢复软件(data recovery software)取回该文件。
How to Prevent Your Antivirus Program From Deleting Files
Many antivіrus software programѕ automatically delete suspiciouѕ files during security scans. Although these antivirυs toolѕ let you restore deleted fileѕ, they’ll most likely delete the file again during ѕubsequent scans. To prevent a recurrence, it’s best to configurе your аntivіrus to exempt important fіles when scanning for viruses and malware.
We’ll show you how to prevent your antivirus from deleting files automatically without your approval. This tutorial will cover steps for Windows Defender and popular third-party antivirus software—Avast, AVG, BitDefender, etc.
Before you proceed, confirm that the file(s) is safe and won’t damage your PC and data before exempting it from antivirus scans. Excluding a (harmful) file from being deleted may increase your PC’s vulnerability to malware attacks and other threats.
Note: The troubleshooting steps in this tutorial are applicable to Windows 10, Windows 11, and Mac or (macOS) devices.
Prevent Avast Antivirus from Deleting Files
Follow the steps below to stop Avast from deleting a file, folder, or app when scanning your PC for threats.
- Launch the Avast, select the hamburger menu icon in the top-left corner, and select Settings.
- In the General section, select Exceptions on the sidebar and select the Add Exception button.
- Select Browse.
- Select the checkbox next to the item (file, folder, app, etc.) you want to exempt from Avast scans and select OK.
- Select the Add Exception button to proceed.
That’ll prevent Avast from deleting the selected file(s) during all security scans. Avast also lets you exclude items from a specific type of scan. See the next step for detailed instruction.
- Head to Avast’s Exceptions menu (see step #3) and select Add Advanced Exceptions.
- Head to the File/Folder tab and select Browse to choose the files/folder you want to exclude. Afterward, check the box next to the scan types and select Add Exception.
After this, Avast will skip the file(s) during the selected security scans. Avast will also list all exempted items in the “File or Folder” section. To delete an exclusion, hover your cursor on the item and select the Bin icon. Otherwise, select the Pen icon to edit the exclusion.
Prevent AVG from Deleting Files
AVG is also an Avast-owned security software. The process for preventing AVG from automatically deleting files is similar to Avast’s.
- Launch AVG, select the hamburger menu icon in the top-right corner, and select Settings.
- Head to the General tab, select Exceptions on the sidebar, and select Add Exception.
- Select Browse.
- Select the checkbox next to the file(s) or folder(s) you want to exclude from malware scans, and select OK.
- Select Add Exception to proceed.
To remove a file from the exception list, hover your 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.
- Open BitDefender, head to the Protection tab (on the sidebar), and select Settings in the “Online Threat Prevention” section.
- Select Manage exceptions in the “Exceptions” row.
- Select Add an Exception on the next page.
- Select the folder icon with a magnifying glass in the search box.
- Select the file or folder you want to prevent the antivirus from deleting and select OK.
- In the “Protection Feature” section, toggle-on Antivirus. Afterward, select the checkbox next to the scan types. BitDefender won’t scan the exempted items when you run the selected scans. Select Save to proceed.
Head to the “All exceptions” tab to preview the exempted files. Select the Bin icon to delete a file or select the Pen icon to modify the exception options.
Prevent Windows Defender from Deleting Files
Windows Defender also lets you exclude items—files, file types, processes, folders, etc.—from security checks. In this section, we’ll show you how to configure the Windows Security settings so that your PC won’t automatically delete files it suspects to be malicious.
- On a Windows 11 computer, go to Settings > Privacy & security > Windows Security.
For Windows 10, head to Settings > Update & Security and select Windows Security.
- Select Virus & threat protection in the “Protection areas” section. That’ll launch the Windows Security app.
- Scroll to the “Virus & threat protection settings” section and select Manage settings to open Windows Defender settings menu.
- Scroll to the “Exclusions” section and select Add or remove exclusions.
- Select the Add an exclusion button.
- Select File from the options, since you’re trying to prevent Windows Security (or Windows Defender) from deleting a specific file type.
- Navigate to the folder or destination where the file is located on your computer and select the file you want to stop Windows Defender or Windows Security from deleting. Select Open to continue.
- To stop Windows Defender from deleting a particular file type or extension, select File type in the drop-down menu and enter the extension in the box.
Note: You can enter the file extension with or without the preceding period (.). Say you want to stop Windows Security from flagging 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 into the dialog box.
- Select Add to include the file type in Windows Defender’s exclusion list.
- To exclude a specific process, return to the “Exclusions” menu (see step #4), select the Add an exclusion button, and select Process.
- Enter the process name and select Add.
Quick Tip: Launch Task Manager and go to the Details tab to view a list of all processes running on your Windows computer. Check the “Name” column for the name of each process.
When you exclude a process in the Windows Security settings, files opened by that particular process will also be excluded during real-time protection. However, the process’ files won’t be exempted during on-demand and scheduled scans.
You’ll find excluded files, folders, file types, processes, and other items in 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 keeps deleting your files.
One More Thing: Disable Storage Sense in Windows
Storage Sense isn’t an antivirus. 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 program isn’t the culprit, consider disabling Storage Sense.
Note: Storage Sense doesn’t delete items in the Downloads folder or items saved by cloud storage services like OneDrive.
Go to Settings > System > Storage and toggle off Storage Sense in the “Storage management” section.
There are hundreds of antivirus software out there. If you don’t use any of the apps mentioned above, contact the developer or check the developer’s website to learn how to prevent that antivirus from deleting files when scanning for malware.
Losing important files can be terrible. If your antivirus deleted a file you haven’t added to its exception list, you can always get back the file using data recovery software.