What to do if your computer has a virus
If your computer is running slowly, showing unexpected pop-ups, or behaving strangely, a virus may be present. The fastest way to remove it is to run a dedicated antivirus scan using software like Malwarebytes, Windows Defender (built into Windows), or Avast. Most of these tools will detect and remove the virus automatically once you start the scan. If your computer is too slow to run a scan, or if the virus blocks antivirus software from opening, you may need to restart in Safe Mode first — a stripped-down version of Windows that loads fewer programs and gives antivirus tools a better chance to work.
For most people, a single antivirus scan removes the problem. If the virus persists after scanning, you have two options: run a second scan with a different antivirus tool (viruses sometimes hide from one program but not another), or back up your important files and reinstall Windows entirely. A full reinstall is the most thorough solution but also the most time-consuming.
Key Takeaways
- Download and run Malwarebytes or Windows Defender to scan your computer; most viruses are removed automatically during the scan.
- If your computer is too slow to run a scan normally, restart it in Safe Mode with Networking to give antivirus software a better chance to work.
- If a virus blocks antivirus software from opening, use a bootable antivirus tool like Kaspersky Rescue Disk, which runs before Windows loads.
- If one antivirus scan does not remove the virus, run a second scan with a different tool, because some viruses hide from certain programs.
- A full Windows reinstall is the most reliable way to remove a stubborn virus, but it erases all your files unless you back them up first.
Running an antivirus scan in normal mode
Start by downloading antivirus software on the infected computer itself. Windows Defender is already installed on Windows 10 and 11, so you can open it immediately by typing "Windows Defender" into the search box. If you prefer a different tool, Malwarebytes and Avast both offer free versions that work well for one-time scans.
Once the antivirus software is open, look for a button labeled "Scan" or "Full Scan" and click it. The scan will take 15 minutes to an hour depending on how many files your computer has. During the scan, the software will check every file on your hard drive against a database of known viruses. When it finds a match, it will either remove the file automatically or ask you to confirm the removal. Let the scan finish completely before restarting your computer.
After the scan completes, restart your computer and run the scan one more time to make sure the virus is gone. If the antivirus software reports no threats on the second scan, the virus has been removed.
Using Safe Mode when your computer is too slow
If your computer is so slow that antivirus software takes hours to open or crashes during the scan, restart in Safe Mode. Safe Mode loads only the essential Windows files and drivers, which makes antivirus tools run much faster and prevents the virus from interfering with the scan.
To restart in Safe Mode on Windows 10 or 11, hold down the Shift key and click the power button in the bottom right corner of the screen. Select "Restart" while holding Shift. Your computer will restart and show a blue screen with several options. Click "Troubleshoot," then "Advanced Options," then "Startup Settings," then "Restart." When your computer restarts again, press the number 4 or F4 to enter Safe Mode with Networking (Networking allows you to download antivirus software if you do not already have it).
Once you are in Safe Mode, download and run your antivirus scan as usual. Safe Mode will not remove the virus by itself, but it gives antivirus software the space it needs to work properly.
Removing viruses that block antivirus software
Some viruses are designed to prevent antivirus software from opening at all. If you try to open Windows Defender or Malwarebytes and nothing happens, or if you see an error message saying the program is blocked, you need a bootable antivirus tool — software that runs before Windows loads, so the virus cannot interfere with it.
The most common bootable tool is Kaspersky Rescue Disk. Download it on a different computer, write it to a USB drive using the instructions on Kaspersky's website, then plug the USB drive into your infected computer and restart. Your computer will boot from the USB drive instead of from Windows, and Kaspersky will scan your hard drive automatically. This process takes 30 minutes to an hour and removes most viruses that block normal antivirus software.
If you do not have access to another computer, you can also try restarting your infected computer in Safe Mode and using the command line to delete the virus file manually. This requires knowing the file name and location, which you can sometimes find by searching online for the virus name. However, this method is more technical and more likely to cause problems if you delete the wrong file.
Running a second scan with different antivirus software
If your first antivirus scan reports that the virus is removed, but your computer still behaves strangely, run a second scan with a different antivirus tool. Some viruses are designed to hide from specific antivirus programs, so a second tool may catch what the first one missed.
Good options for a second scan include Malwarebytes (if you used Windows Defender first), Avast (if you used Malwarebytes first), or Kaspersky. Download the new tool, run a full scan, and let it remove any threats it finds. Restart your computer and check whether the strange behavior has stopped.
If your computer still has problems after two scans with different tools, the issue may not be a virus — it could be malware, spyware, or a hardware problem. In that case, consider taking your computer to a repair shop or backing up your files and reinstalling Windows.
Backing up files and reinstalling Windows
If antivirus scans do not remove the virus, or if you want to be absolutely certain it is gone, reinstall Windows. This erases everything on your hard drive and installs a fresh copy of Windows, which removes any virus along with all your other files.
Before you reinstall, back up any files you want to keep. Plug an external hard drive into your computer, open File Explorer, and copy your Documents, Pictures, Downloads, and Desktop folders to the external drive. This takes 10 minutes to an hour depending on how many files you have. Once the backup is complete, you can safely reinstall Windows without losing your important files.
To reinstall Windows, go to Microsoft's website and download the Windows installation tool. Follow the on-screen instructions to create a bootable USB drive, plug it into your computer, restart, and boot from the USB drive. The installation process will guide you through erasing your hard drive and installing a fresh copy of Windows. After Windows is installed, plug in your external drive and copy your backed-up files back to your computer.
Preventing future viruses
After you remove the virus, take steps to prevent another one from infecting your computer. Keep Windows and all your software up to date by turning on automatic updates. Use antivirus software continuously — Windows Defender is free and runs in the background on Windows 10 and 11. Avoid downloading files from untrusted websites, and be cautious about opening email attachments from people you do not know.
Use a password manager to create strong, unique passwords for each website you visit. Viruses often spread through weak passwords that hackers can guess. If you use the same password on multiple sites, a hacker who cracks one password can access all your accounts.
Frequently Asked Questions
How long does it take to remove a virus?
A single antivirus scan usually takes 15 minutes to an hour. If the virus is removed on the first scan, you are done. If you need to run a second scan with different software or use Safe Mode, the total time may be 2 to 3 hours. A full Windows reinstall takes 1 to 2 hours plus the time to back up and restore your files.
Can I remove a virus without antivirus software?
It is possible but difficult. If you know the virus file name and location, you can delete it manually using File Explorer or the command line. However, viruses often hide their files or use fake names, so manual deletion usually does not work. Antivirus software is much more reliable because it recognizes viruses by their code, not just their file names.
Will restarting my computer remove a virus?
No. Restarting your computer does not remove a virus — it just stops the virus from running temporarily. The virus will start again the next time you restart. You need antivirus software to actually remove the virus files from your hard drive.
Is it safe to use my computer while a virus is on it?
It depends on what the virus does. Some viruses just slow down your computer or show pop-ups. Others steal passwords, banking information, or personal files. If you suspect a virus, avoid entering passwords or financial information until the virus is removed. If you must use your computer, use it on a different account that does not have access to sensitive files.
What if the virus comes back after I remove it?
If the same virus returns after you remove it, it may be reinfecting your computer from an external source — a USB drive, an email attachment, or a website you visit regularly. Scan all USB drives you use with antivirus software, avoid opening suspicious email attachments, and be more cautious about which websites you visit. If the virus keeps returning, a full Windows reinstall is the most reliable solution.