What to do if your computer has a virus

If your computer is running slowly, showing pop-ups you didn't click, or opening programs on its own, it may have a virus. The fastest way to remove it is to run a full system scan with antivirus software — either the program already on your computer or a free one you download. Most scans take 30 minutes to two hours and will quarantine or delete infected files automatically.

If your computer won't start or you can't open antivirus software, you may need to restart in Safe Mode, which loads only essential programs and makes viruses less likely to run. From there you can download and run a scan, or use a bootable antivirus tool on a USB drive from another computer.

Key Takeaways

  • Download antivirus software (Windows Defender is built into Windows; Mac users can try Malwarebytes) and run a full system scan to find and remove infected files.
  • If your computer won't respond, restart in Safe Mode with Networking so you can still download tools while viruses stay dormant.
  • A bootable antivirus USB lets you scan a computer that won't start normally — create one on another computer if needed.
  • After removal, change passwords for email and banking accounts from a different device, since the virus may have stolen login information.
  • Keep antivirus software running and enable automatic updates to prevent the same virus from returning.

Running a full system scan on Windows

Windows 10 and 11 come with Windows Defender already installed. Open it by typing "Windows Defender" into the search box, then click "Virus & threat protection." Select "Scan options" and choose "Full scan," which checks every file on your computer. This scan can take one to three hours depending on how much data you have.

If Windows Defender doesn't find the virus or you want a second opinion, download Malwarebytes (free version available at malwarebytes.com) or Kaspersky Rescue Disk. Install it, restart your computer if prompted, and run a full scan. These programs often catch threats Windows Defender misses because they use different detection methods.

When the scan finishes, review the results. Most antivirus software will automatically quarantine (isolate) or delete infected files. If it asks whether to remove something, click yes unless the file name looks like a legitimate program you use daily — in that case, search the file name online first to confirm it's actually malicious.

Removing a virus when your computer won't start normally

If your computer freezes, won't open programs, or displays a warning message that won't close, restart it and press F8 repeatedly as it boots up (on some computers it's F5 or Shift+F8). This opens the Advanced Boot Options menu. Select "Safe Mode with Networking" so you can download antivirus tools while the virus stays dormant.

Once in Safe Mode, open your web browser and download Malwarebytes or Windows Defender offline installer. Run the scan and let it remove anything it finds. Safe Mode loads only the bare minimum programs needed to run Windows, so viruses usually cannot execute or defend themselves.

If Safe Mode doesn't work or your computer won't boot at all, you need a bootable antivirus USB. On another computer, download Kaspersky Rescue Disk or Bitdefender Rescue Disk (both free), write the file to a USB drive using a tool like Rufus, then plug that USB into the infected computer and restart. The computer will boot from the USB and scan your hard drive without loading Windows at all.

Cleaning up after virus removal

After antivirus software removes the virus, change your passwords immediately — but do it from a different device like a phone or tablet. Viruses often steal login credentials before they're removed, so use a computer you know is clean to change passwords for email, banking, social media, and any other accounts where you use the same password.

Check your browser homepage and search engine settings. Viruses frequently change these to redirect you to malicious websites. In Chrome, Firefox, or Edge, go to Settings and look for "Home" or "Search engine." If they've been changed to something unfamiliar, change them back to Google, Bing, or your preferred search engine.

Look at your installed programs for anything you don't recognize. Open "Add or Remove Programs" (Windows) or "Applications" (Mac), scroll through the list, and uninstall anything suspicious or unfamiliar. Viruses sometimes install additional malware alongside the main infection.

Preventing the same virus from returning

Keep your antivirus software running at all times and set it to scan automatically — most programs do this weekly by default. Enable automatic updates for both your antivirus software and your operating system (Windows, Mac, or Linux). Viruses often exploit security holes that patches have already fixed, so staying current closes those doors.

Be cautious with email attachments and downloads. Don't open attachments from people you don't know, and download programs only from official websites or trusted app stores. Avoid clicking links in unsolicited emails or text messages, even if they look like they're from your bank or a service you use.

If you use the same computer for work and personal use, consider creating a separate user account for work. If a virus infects the personal account, it won't automatically have access to work files. Back up important files regularly to an external drive or cloud storage so you can restore them if a future infection forces you to wipe your computer.

When to take your computer to a professional

If you've run multiple antivirus scans and the problems continue — your computer still runs slowly, programs still open on their own, or you still see unfamiliar pop-ups — the infection may be deeply embedded or your hard drive may be failing. A computer repair technician can run more advanced diagnostic tools and determine whether the virus is still present or whether hardware damage is causing the symptoms.

If your computer won't start even in Safe Mode and you don't have another computer to create a bootable USB, a technician can do this for you. They can also recover files if you decide to wipe the computer and reinstall Windows from scratch, which is sometimes faster than fighting a stubborn infection.

Frequently Asked Questions

Is it safe to keep using my computer while it has a virus?

No. A virus can steal passwords, financial information, and personal files while you use the computer. It may also use your computer to attack other people's devices. Stop using it for sensitive tasks like banking or email until you've run a full scan and confirmed the virus is gone.

Will restarting my computer remove a virus?

Restarting alone won't remove a virus, but it can help you get into Safe Mode where antivirus software works better. Some viruses run from temporary memory and disappear after a restart, but most are stored on your hard drive and will return when you boot normally.

Can I remove a virus with just Windows Defender?

Windows Defender catches many common viruses, but not all. If a full Windows Defender scan finds nothing but your computer still has symptoms, download Malwarebytes or Kaspersky and run another scan. Different antivirus programs detect different threats.

What if antivirus software says it found a virus but won't remove it?

Some viruses lock files so antivirus software can't delete them while Windows is running. Restart in Safe Mode and scan again — the virus will have fewer defenses. If it still won't remove, try a bootable antivirus USB, which scans before Windows loads at all.

Do I need to buy antivirus software or is free software enough?

Free antivirus software like Windows Defender, Malwarebytes, and Kaspersky Rescue Disk removes most viruses effectively. Paid versions add features like real-time monitoring and automatic updates, but free versions work for one-time removal. For ongoing protection, enable automatic scans in whatever free software you choose.