Learn How to Identify and Remove Viruses That Are Infecting Your Files

File virus definition and tools to remove viruses

Close up of a flat swatter on a black background

Douglas Sacha / Getty Images

A file virus infects executables, usually EXE files, by inserting special code into some part of the original file so that the malicious data can be executed when the file is accessed.

The reason a virus infects executables is that, by definition, the executable is a kind of file that is executed and not simply read. For example, EXE and MSI files (both executables) are files that run code when opened.

These are different than non-executables like JPGs or macro-free DOCX files that simply serve to show you an image or group of text.

File viruses are sometimes called file infectors or simply viruses and incorrectly identified as keyloggers, adware, spyware, ransomware, worms, and other forms of malware.

Types of File Viruses

Viruses are set apart from other types of malware in that they are self-replicating. They infect other executable files against the user's permission, and may or may not affect the overall performance of the device.

One type of virus is the overwriting file virus, which is one that overwrites the original file entirely, replacing it with the malicious code. These kinds of viruses should be promptly removed since anything affected by an overwriting virus cannot be disinfected.

Loveletter, which operated as an email worm, file virus, and Trojan downloader, is a notorious example of a file overwriting virus. Loveletter searched for certain file types and overwrote them with its own malicious code, permanently destroying the contents of those files.

Another kind of virus is one that simply drops a small amount of malicious code into the file. The program or executable might run perfectly fine but the virus is hidden inside and will launch at a designated time (often called a time bomb), or maybe it's always running but isn't affecting the usability of the file that it has infected.

Therefore, virus files can be created to go off at certain trigger points, like when the file is opened or even when an unrelated event takes place, such as when another program is running. The file virus might otherwise exist in secret and never affect anything until that one trigger takes place.

This second type of file virus can usually be disinfected with an antimalware program or antivirus tool.

Other file viruses might replicate on the device or network to infect other executable files. They can even infect the boot sector and affect how the computer boots, sometimes rendering your computer or device completely inoperable until the malicious data is removed.

How to Identify a File Virus

It's extremely important to be fully aware of the file types that are common for viruses to target. See our List of Executable File Extensions for files that you should watch out for since they could potentially be harboring file viruses.

Some file viruses are saved in a sneaky way to make you think that they're harmless. For example, you might download a file called video.mp4.exe that appears to be an MP4 video file. As you can see, the true suffix is ".EXE" since those are the letters that follow the final period in the file name.

File infecting viruses have targeted a range of operating systems, including Mac, Unix, Windows, Linux, and DOS. They can spread through email file attachments, online downloads, malformed URL links, and more.

See How to Safely Download & Install Software to learn how to protect yourself from file virus downloads.

How to Delete or Prevent File Viruses

Viruses are best removed on the spot before they can do any real damage. Ensure that you're running the latest version of your antivirus software so that any existing threats can be taken care of right away.

If you can't log in to your computer to delete the file virus or to inspect what's going on, try booting into Safe Mode if you're using Windows, or use a bootable antivirus program to scan the computer for file viruses before the OS tries to load.

Some viruses might be loaded into memory and appear to be locked when trying to remove them. You might be able to shut down the virus process with Task Manager or some other tool that can force-close pesky processes.

See How to Properly Scan Your Computer for Malware to learn more about how to delete viruses and other harmful malware.

Aside from using an antivirus program, one of the best ways to stop file viruses is to keep your operating system and software updated. Use a free software updater to keep your third-party programs freshly updated, and Windows Update to ensure that Windows itself is always patched with the latest security fixes.