Fix: Operation Did Not Complete Successfully Because The File Contains A Virus

Have you encountered the “Operation did not complete successfully because the file contains a virus” error? Here are ways you can do to get it fixed.

In a time when we use computers for everything from work to entertainment, ensuring your system’s safety should be a top priority.

One of the most frightening things to experience in the computer world is getting a message that your computer has a virus.

Unfortunately, that’s what the prompt message states when a user encounters the “Operation did not complete successfully because the file contains a virus” error.

Did you recently encounter this issue? Keep on reading to learn more.

Let’s get into it.

Table of ContentsShow

The Problem Explained

Problem

There are two common reasons for the “Operation Did Not Complete Successfully Because The File Contains A Virus” error to occur:

  • You downloaded a file from untrusted sources. It may have a virus or malware infection, so the built-in Windows security system prevented access to protect your computer.
  • You downloaded a legitimate, genuine file, but since the source is unknown or unreputable, the Windows security system makes a false positive and marks it as a threat, blocking all access.

To simplify, this can happen in both cases, when you download legitimate files, so a false positive, or when a real threat is detected. In both cases, the error occurs due to the security software blocking your access to the file.

False positives are common in the cyber-security world. However, to ensure that is the case and remain safe, follow the methods in the sections below.

Ensuring You Download Safe Files – Security Best Practice

Antivirus

Sometimes we’re compelled to download files from unofficial platforms, as not every beneficial piece of software is available on the Microsoft Store or popular platforms such as Steam.

With that said, it’s common to experience a false positive as the Windows Security system is overly-cautious for our safety.

However, before you proceed to unpack a file you just downloaded after it got “flagged” as a virus or malicious software, ask yourself the following questions:

  • Can I find the same version of this software/game on an official platform? Did I thoroughly check the internet for a more reputable distributor for this specific software?

Occasionally, well-liked add-ons, tools, and software are present on GitHub with their open-source code, but can also be found on third-party sites repackaged and presented as an “upgraded edition” by an unidentified uploader, with concealed code. Always ensure you locate the most trustworthy upload for the particular software or game you intend to download. Avoid clicking the initial link. Utilize community-based websites like Reddit to investigate these subjects and ascertain if anyone has downloaded that file from the lesser-known source.

  • If I must download this file from an unofficial source, did I research the uploader’s reputation or read the comments from other users on the file’s download section?

Even if you’re downloading a torrent, you can check the uploader’s history, comments on other torrents they’ve uploaded, and their website if they have one. That will help you gather more information and decide if the file is worth the risk.

  • Have I researched everything about this file/software and ensured it’s reputable and cannot exploit my computer in any way?

It’s unfortunate, but numerous times in the past, there were cases of what seemed like legitimate software used by thousands to turn out as a harmful exploit file. One of the most popular examples is the famous ESEA client that contained a hidden Bitcoin miner in the code, exploiting users’ computing power for the company’s benefit.

So, ensure to read user experiences and always try to find and download an open-source version of the software (if available) from reputable places such as GitHub.

If you’ve given your best to find the most secure, most reputable version of the file you wish to download, and you’re convinced that the flag is a false positive, here’s what you can do to overcome the “Operation did not complete successfully because the file contains a virus” error on Windows.

Fix 1: Add The File As An Exclusion In Windows Security

Folder

Adding files as an exclusion in your antivirus software is the simplest way to avoid false positives. However, you must be careful not to exclude a file that can harm your PC in any way.

If you’ve read the previous section for best security practices and still decide that the file you downloaded is safe, here’s what you can do to solve the “operation did not complete successfully because the file contains a virus” error.

  1. Simultaneously press Windows and S on your keyboard to bring up the Search Bar.
  2. Type Windows Security and press Enter on your keyboard to initiate the search.
    Windows and S
    Windows Security
  3. Click on Virus & Threat Protection in the left sidebar menu.
    Virus & Threat Protection
  4. Scroll down until you see the Virus & Threat Protection Settings section, then click Manage Settings, as shown in the image below.
    Windows Virus & Threat Protection Settings
  5. Scroll down until you see the Exclusions section, then click on Add or remove exclusions.
    Windows Add or remove exclusions
  6. Click the Add an exclusion button, then choose whether you wish to add a folder, a single file, a process, or anything else.
Windows Add an exclusion

Once you’ve added the files as an exclusion, there’s one more thing to do before you can access them without getting the error, removing them from quarantine.

If you’ve already seen this error, chances are the file(s) already got flagged by Windows Security and are currently unusable.

To remove them from quarantine, follow these steps:

  1. Do everything up to step #3 from the guide above, and then instead of clicking Manage Settings, as shown in step #4, click Protection History instead, as shown in the image below.
    Windows Protection History
  2. Now, locate the file on the list, click it, and then click on Actions.
  3. Choose the correct action, such as restoring the deleted file.

Now, you should be able to use the files without getting the same error. The Windows Security system won’t do anything regarding those files as you’ve successfully added them to the list of exclusions, ultimately marking them as safe.

Hopefully, this will fix the error, as it’s the most successful method for solving this problem.

Fix 2: Temporarily Disable All Antivirus Protection On Your PC

Disable

This one is a faster and simpler method compared to the previous one, but not as dedicated to security. Here’s why.

It’s much quicker to press one button and fully disable antivirus protection, then install any third-party files without worrying about seeing an error like the “operation did not complete successfully because the file contains a virus” one.

However, even if the files you’re trying to access are marked as a false positive, entirely disabling your antivirus allows any other threats that have been “lurking” to get an opportunity and “dig” into your system.

That is why we recommend using the first method, as it’s a lot more “precise” and allows you to exclude only those files you’re sure are not a threat.

But, if you want to fix this error quickly and at your own risk, disabling the Windows Security antivirus and any other third-party antivirus programs should do the trick.

Fix 3: Repair File Explorer & Run The System File Checker

Fix or Troubleshoot

According to some users who fixed this problem using this method, the error can sometimes occur due to a malfunction of the File Explorer service (previously known as Windows Explorer).

To fix it, run two simple Command Prompt commands.

Here’s how:

  1. Simultaneously press Windows + S on your keyboard to bring up the Search Box.
  2. Type in Command Prompt, right-click the first result, and choose Run as Administrator to launch an elevated version required for this fix.
    right clicking Windows 10 Command Prompt and selecting Run as Administrator
  3. When Command Prompt opens, type in sfc /SCANFILE=c:windowsexplorer.exe and press Enter to execute it. Then, do the same for sfc /SCANFILE=C:WindowsSysWow64explorer.exe and press Enter on your keyboard.

Wait for the confirmation message. Then, run the System File Checker command by typing in sfc /scannow and pressing Enter on your keyboard in the same Command Prompt window.

Windows cmd sfc :scannow

Wait until it executes and the process is complete (you’ll get a confirmation message), then restart your PC.

Now, the problem should no longer occur.

Conclusion

That covers everything you should know about this troubling PC error. Hopefully, the methods listed in this guide will help you access the files you previously couldn’t due to the error while following the best security practices, ensuring your PC is always safe and sound.

Related Reads

Device Descriptor Request Failed (Unknown USB Device) In Windows 10 & 11
Fix: Device Descriptor Request Failed (Unknown USB Device) In Windows 10 & 11
Bojan Veselinovikj
LinkedIn

Bojan is a video-game developer and a tech enthusiast. Combining these two passions allow him to keep you informed on everything that's new in this fast-paced digital world.