Type to search

Operation Did Not Complete Successfully Because The File Contains A Virus [Solved]

If you download a file that contains a virus or has potentially unwanted software then your presently activated antivirus program won’t allow you to open the file. 

Usually, Windows 10 comes along with an inbuilt Defender. Its sole purpose is to stop the execution of such malicious files. In this situation, you might encounter an error message ‘Operation did not complete successfully because the file contains a virus’.

Often, such this message keeps appearing even if you open a known program. Basically, it is a false alarm as antivirus programs are designed to detect every unverified object as a threat.  

Now, this error message keeps appearing then it can stop you from continuing your daily work. So, if you want to get rid of this issue, then you can follow the instructions presented through this guide. So, let’s begin. 

Eliminate “Operation Did Not Complete Successfully Because the File Contains a Virus” from Windows 10 [Easy Hacks]

There are several ways to fix this problem. You can perform all the ways explained below: 

Fix 1: Disable Windows Defender Temporarily

Disable Windows Defender TemporarilyIf Windows Defender is stopping you from accessing certain files and keeps on repeating the message, then you should disable it temporarily.

How to Disable Windows Defender? 

  • In the beginning, go to the Shield icon located in the Taskbar and right-click on it. 
  • Click on the Open button. 
  • Once it opens the Windows Defender Security Center, tap on the Shield icon (near to the Home button). 
  • Navigate to the ‘Virus & Threat Protection’ section and turn the ‘Real-time Protection’ off. 
  • Afterward, turn off the ‘Cloud-based protection’.
  • Next, go to the Browser icon and disable the ‘Check apps and files’ option.

[Note: Make sure that you have turned On all the functions that you just disabled later. As it is dangerous to leave the system unprotected even]

Now, you can check if the message reappears or not. Else, you can move on to further solutions stated below. 

Fix 2: Update Windows Defender or Other Security Software

Update Windows Defender or Other Security Software


Virus databases are constantly getting filled with new threats and thus if you are still using an outdated security program then it may result in several problems.

Henceforth, you can resolve the ‘Operation did not complete successfully because the file contains a viruserror message by updating the Windows Defender or other security software you are using to protect your computer. 

How to Update the Windows Defender? 

  1. First and foremost, go to the Start menu and click on the Settings (gear-shaped) icon. 
  2. Afterward, navigate to the ‘Update & Security’ category. 
  3. Tap on the ‘Windows Security’ option from the left pane of the screen. 
  4. Now, search for the ‘Virus & threat protection updates’ by scrolling down the page and click on it. 
  5. On the next page, tap on the ‘Check for updates’ button. 
  6. Now, it will start to search for the available updates. If it finds the latest update, then it will download and install that automatically. 

After updating the Windows Defender, you can check if the issue is resolved. Otherwise, you can use the Command Prompt to eliminate any further risk. 

Fix 3: Using Command Prompt

Using Command PromptYou can also face this error due to the explorer.exe or Windows Explorer process. If the explorer.exe file gets damaged, then you can solve it by using the Command Prompt. Here are the steps that you need to follow: 

  • First of all, bring up the Start menu and type “command prompt” in the search bar. 
  • Afterward, right-click on the ‘Command Prompt’ from the search result. 
  • Next, select the ‘Run as administrator’ option from the list to open the Command Prompt with admin privilege. 
  • If you get a pop up named User Account Control, tap on the Yes button. 
  • Now, type the command “sfc /SCANFILE=c:\\windows\\explorer.exe” in the command line. Hit the Enter key from the keyboard to execute the command. 
  • Afterward, run the command “sfc /SCANFILE=C:\\Windows\\SysWow64\\explorer.exe”. 
  • Now, Windows will start to perform a scanning process that will determine if there are any violations. If yes, then Windows will fix that automatically. 

Now, you can check if the issue still continues. Else, you can perform the solutions described below. 

Fix 4: Rectify the problems with Windows Backup

Rectify the problems with Windows BackupThe  ‘Operation did not complete successfully because the file contains a viruserror message can also arise while running any faulty Windows backup process. So, start by disabling these files. Here’s how to do this: 

Step 1: 

Open the Control Panel by going to the Start menu. Now, go to the ‘View by’ option and click on the ‘Large icons’ option. 

Step 2: 

Navigate to the ‘Internet Options’ category. Now, go to the General tab and then go to the ‘Browser History’ section. Tap on the Delete button and select the options that you wish to remove from the browser.

Step 3: 

Afterward, untick the box that prompts ‘Preserve Favorites website data’. Then, check the ‘History’, ‘Cookies and website data’, and ‘Temporary Internet files and website files’ box. 

Step 4: 

Next, tap on the Delete button and then close the Control Panel. Afterward, restart the computer and check whether the error still occurs or not. 

Additional Method: Edit the Registry Files

Edit the Registry FilesIf all the above methods failed to eradicate this error message, then you can edit the registry entries of the system to get rid of this issue. 

Before that, you have to create a back up of the registry file. Go to the ‘File’ and click on the Export option. Afterward, choose the ‘All option’ as the ‘Export range’. 

Next, type your desired name and choose the output folder. Lastly, tap on the Save button to complete this process. 

How to Edit the Registries?

Now, to edit the registry entries you should go by following the steps given below: 

  1. Right at the beginning, hit the R and Win key both at the same time to launch the Run Command box. 
  2. Afterward, type “regedit” in the Run box and hit the Enter key to proceed. 
  3. Go to the “HKEY_LOCAL_MACHINESOFTWAREPoliciesMicrosoftWindows Defender” from the left pane of the screen. 
  4. Now, search for the ‘DisableantiSpyware DWORD’ option in the right pane of the next page. 

[Note: If you are unable to locate that, then right-click on the empty space in the right pane and click on the New option. Then, choose the ‘DWORD (32-bit value)’ option from the list. Afterward, enter the ‘DisableAntispyware’ as a new DWORD and click twice on it.] 

At last, set the Value data to 1. Tap on the OK button to apply the changes. Now, you should check whether the error has been resolved. 


These are the probable ways through which you can easily get rid of the ‘Operation did not complete successfully because the file contains a viruserror message. 

We hope if you apply the above hacks in their corresponding order, then it will definitely help you to put an end to this problem. But still, if you have any doubts or queries regarding this topic, then you can share that in the comment box.