How computer viruses spread and how to avoid them
You know that computer viruses can be a nightmare; here's how they spread from one computer to the next

It’s a horrifying moment most people have been through at least once. You’re working on your computer when it suddenly locks up and new windows pop up everywhere. Your computer is now infected with a virus and virtually useless until you fix it.
How does a computer get a virus in the first place? Similar to viruses that affect humans, computer viruses spread from one computer to another. Unlike a human virus, though, they’re not from someone sneezing near you or touching a contaminated handrail.
Understanding how viruses spread between computers is the first step to avoiding them.
What are computer viruses?
A computer virus is a type of program or malicious code designed to alter how your computer operates. It’s also designed to spread from one computer to another. The virus attaches itself to a host program or document and executes its code through the host.
A virus can cause significant damage to the computer’s software, destroy data or even encrypt data and hold it for ransom.
Hackers design viruses for specific purposes. Some steal personal information, such as passwords or sensitive data. Others send spam emails to all your contacts. Some even take over your computer completely.
3 common ways computer viruses spread
Computer viruses aren’t random. You can’t just turn on your computer and suddenly have a virus for no reason. Somehow, it had to be installed on your machine, and there are three primary ways this happens.
Infected email attachments
Computer viruses can’t infect your computer through a text-only email. However, if an email includes an attachment or clickable link, those could be vehicles for a virus. If you open an attachment or click a link, your computer downloads that information. If that attachment or link includes a virus, your computer is now infected.
Hackers can sometimes mask malicious links as other things, like images or text, that bait you into clicking or are so large you click them inadvertently.
Removable Media
When you attach a memory card, USB flash drive, external hard drive or any other kind of removable media to your system, you face the potential of importing a virus. If a hacker attached a virus to a program or file on the drive, you’ll also install the virus when you plug in the media.
Internet Downloads
When you download anything off of the internet, you’re installing new files and code on your computer. Many viruses are attached to freebie downloads, including free software trials or, ironically, free virus protection.
Anything downloaded illegally, like music, movies or games, is an easy target for hackers because you’ll probably be getting that file in a peer-to-peer format. Even your antivirus program may not be able to stop it.
How to protect yourself from computer viruses
Viruses are a fact of life when operating a computer. Like it or not, you must be on guard against them at all times.
While there may not be a single foolproof way to safeguard your machine against all possible viruses, there are a few things you can do to keep the odds in your favor.
- Always have antivirus protection on your computer. Always keep your antivirus on and make sure you’re getting updates regularly so you’ll be defended against the latest known viruses. With a little research, you can find the best antivirus software.
- Never click on any link or attachment you receive in an email unless you’re absolutely certain it’s from someone you know and trust.
- If your bank or another company you do business with sends you an email asking for personal information, don’t click the link. Instead, open a new window and log in to your account with that company. There’s a good chance it’s a fake email that could steal your information or give your system a virus.
- Scan any removable media before opening any files or programs on it. Your antivirus software can scan and remove viruses from removable media the same way it can your computer.
- Keep your email safety features on.
- Stay up to date with your computer system’s critical updates. Those updates continually plug security holes to protect your system. Set your computer up to update automatically so you don’t have to even think about it.
- Enable your firewall protection. Both Mac and PCs have it, but that doesn’t mean it’s operating. Verify your firewall is active and protecting your computer.
- Back up your computer. If the unthinkable happens, a backup of your computer on an external hard drive or in the cloud allows you to recover what you need if a virus obliterates your machine.
Managing security risk and compliance in a challenging landscape
How key technology partners grow with your organisation
Download nowEvaluate your order-to-cash process
15 recommended metrics to benchmark your O2C operations
Download nowGetting started with Azure Red Hat OpenShift
A developer’s guide to improving application building and deployment capabilities
Download now