Operation Did Not Complete Successfully Because the File Contains a Virus

Whenever you run the files which contain some virus or malware issues then the Windows Defender or the Antivirus software come into effect and will not allow you to run the file.

Then an “Operation did not complete successfully because the file contains a virus” is the error which the users usually get from the security applications.

If you think that the files or folders which are genuine and do not pose any error and are causing trouble, then go through the below-listed solutions to solve your problem.

Operation Did Not Complete Successfully Because the File Contains a Virus

Understanding the Error Message

Deciphering the Message

The error message “Operation Did Not Complete Successfully Because the File Contains a Virus” is a notification from your computer’s antivirus or security software.

It appears when you attempt to perform an action on a file, such as downloading, opening, copying, or moving, and the security software detects a potential threat within the file. This message is a precautionary measure designed to protect your system from potentially harmful files.

Read Also:

  2. System Thread Exception Not Handled
  3. Ethernet Doesn’t Have a Valid IP Configuration

Reasons for the Error

Antivirus Detection

  1. Malware Presence: The most common reason for this error message is the presence of malware or a virus within the file. Antivirus software employs heuristic analysis and signature-based detection to identify suspicious patterns or known threats.
  2. False Positives: In some cases, the antivirus software may generate a false positive, flagging a harmless file as a potential threat. This can occur due to similarities between the file and known malware or due to unusual file behavior.

Downloaded Files

  1. Unsafe Sources: Downloading files from untrustworthy or suspicious websites increases the risk of encountering infected files. These files may contain malware, and antivirus software is vigilant in detecting them.
  2. Email Attachments: Email attachments can also trigger this error if the attached files are identified as potential threats by the antivirus software.

Fix Operation Did Not Complete Successfully Because They Contains Virus

So, here we will discuss about some of the solutions to fix the issue Operation did not compelte because they contains error. So let’s get started.

Solution 1: Disable Windows Defender / Third-party Antivirus Program

In any Windows Operating System, by default Windows Defender or installed antivirus software are the security programs that protect your system against viruses, malwares, spyware, and network threats.

Though Windows Defender alone is a free security service that works without any additional third-party antivirus application. But, most of the people prefer high rated third party antiviruses because it has more virus detection capability than Windows Defender.

Many users have reported that even after the installation of many security applications many errors are encountered in their system while downloading a file. Of them, one such common one is ” Operation did not complete successfully because the file contains a virus “.

Also, if you activate the files which contain virus the same error pops up. If you are sure that a particular file is genuine and safe to use, you can try opening the file by disabling the windows defender and antivirus softwares temporarily.

Step 1: Click the Start menu and search for Control Panel from the search bar.

Step 2: From a new popup window click on programs to continue.

Step 3: Then search for anti-virus software, right-click on it, and uninstall it.

Step 4: Similarly, search for Windows Firewall and click on it.

Step 5:  Now, on the left side of the screen, under Control Panel Home, select ‘Turn Windows Defender Firewall on or off’.

Step 6: When you are finished with Turning off, click the ‘OK’ button to save the changes.

Step 7: After the disabling of both firewalls and antivirus restart your computer and check if this method has solved your issue or not.

Solution 2: Add an exclusion in Windows Defender / Third-party Antivirus Program

If your system finds any suspicious file which scanning the system then it will not allow you to run the file. If you are sure that a particular file is legitimate to use then you can add it to the exclusion list and run it. So following are the steps to add any file or folder to the exclusion list.

Step 1: Open the settings list from your system and navigate to “Windows Security”.

Step 2: From the Windows Security, click on “Virus & Threat Protection”.

Step 3: Under the Virus and Protection list click on Manage Settings.

Step 4: In the list of settings scroll down to the bottom of the page and click on “Add or Remove Exclusions”. Now you can move any of your files or folders to the exclusion list.

Step 5: Once you are done, close all the tabs which will automatically save the changes.

From next time, when Windows Defender or the Third-party Antivirus software scans your system. You will no longer receive any errors from the files you added to the exclusion list.

Solution 3: Repair File Explorer

File Explorer is one of the builtin file manager application in Microsoft Windows. It allows users to access the file systems using a graphical user interface so as to copy, move, or delete files.

It has a “Quick access” feature which allows you to quickly access the frequently and recently used files. With its skyrocketing features, many users tend to use this application. However, many uses are reporting that their File Explorer is not responding when they browse the saved files.

Constant crashes and errors are the most common problems. Hopefully, if you really want to get rid of this issue try repairing the File Explorer by following the below steps:

Step 1: Click on the Start menu and search for Command Prompt.

Step 2: Right-click on the Command Prompt option and select “Run as Administration”.

Step 3: In the Prompt Window, type sfc/SCANFILE=C:\windows\explorer.exe  and sfc/SCANFILE=C:\windows\SysWow64\explorer.exe . After entering each command hit Enter Key.

Step 4: If the above commands execute you will receive a notification. It states that “Windows Resource Protection found corrupt files and successfully repaired them”. Then, restart your system and open the required folders to check if the error persists.

Solution 4: Run Disk Cleanup Tool

Run Disk Cleanup tool is another built-in feature that cleans your system by deleting files and data. If you are willing to clean up the system follow the below steps –

Step 1: Go to the hard drive’s folder and right-click on any of them to select the Properties option.

Step 2: Now from the Properties window click on Disk Cleanup.

Step 3: From the list of files, you can delete the files which are not necessary and click OK.

Step 4: Restart your system and check for errors. This solution also improves the functioning of the system.

Read Also:

  1. Driver Power State Failure
  2. There Was a Problem Resetting Your PC
  3. io.netty.channel.AbstractChannel$AnnotatedConnectException


The “Operation Did Not Complete Successfully Because the File Contains a Virus” error message is a critical safeguard implemented by your antivirus software to protect your computer from potential threats.

While it may be frustrating, understanding the error’s causes and following the appropriate steps to address it is essential for maintaining a secure and healthy computing environment.

By verifying the credibility of sources, keeping antivirus software updated, and using caution with email attachments, you can minimize the risk of encountering infected files.

Additionally, being aware of false positives and taking steps to restore trusted files from quarantine can help you effectively manage this error and ensure the safety of your digital activities.