Situation

A backup plan fails with the following error on a file or a group of files:

Operation did not complete successfully because the file contains a virus or potentially unwanted software

Solution

The above-mentioned error is reported by the Windows Defender antivirus and means that the antivirus agent has detected suspicious objects potentially containing malware.

Such files, especially if they are executable files (".exe"; ".com"; ".bat", etc.), should be treated with extreme caution, especially in the production environment.

If this error is encountered, immediately stop the current backup operation and exclude the reported file(-s) from the source scope of the backup plan (as you risk preserving the dangerous file otherwise).

Don't dismiss the issue and involve the local system administrator in the evaluation of the potential danger of the reported object(-s) before continuing. Stay safe!