Pop-ups keep appearing, the browser opens pages you never asked for, and the fan runs hard even when the PC is idle. To remove malware from Windows 11, disconnect from the internet, open Windows Security > Virus & threat protection, run a Quick scan, then a Full scan, and finish with a Microsoft Defender Antivirus (offline scan) if the threat keeps coming back. Every tool here is built into Windows 11 or published by Microsoft, and the same process removes trojans.
Signs Your Windows 11 PC May Have Malware
Malware is any software written to harm your PC, steal from you or use your computer for someone else’s purposes. Viruses, worms, spyware, adware, ransomware and trojans are all types of malware. You rarely see the malware itself. What you see are its side effects, and some of those side effects have innocent explanations, so it helps to sort the warning signs into two groups.
Signs that point strongly to an infection:
- Windows Security says protection is off, and you did not turn it off, or the app will not open at all.
- Your browser’s home page, new tab page or default search engine changed on its own, or a toolbar or extension appeared that you never installed.
- Ads and pop-ups show up on the desktop or in sites that normally have none.
- Programs you do not recognize appear in your installed apps list or start when Windows starts.
- Friends receive messages or emails from your accounts that you did not send.
- Files are renamed, encrypted or replaced by a ransom note asking for payment.
Signs that are worth checking but are not proof on their own:
- The PC is slower than it used to be.
- The fan runs loudly while you are not doing much.
- The hard drive or network light is busy at odd times.
A slow PC is often just a full drive, a pending update, too many startup apps or an aging battery. Those symptoms deserve a scan, but do not assume the worst and start deleting files because of them. The steps below begin with safe, reversible actions and only move to drastic ones if the scans find something they cannot fix.
Before You Scan: Contain the Problem
These first steps take five minutes and limit the damage while you work.
Disconnect From the Internet
Turn off Wi-Fi from the network icon in the taskbar, or unplug the Ethernet cable. Many kinds of malware, trojans in particular, talk to a remote server to send stolen data or download more malicious programs. Cutting the connection stops that traffic while you clean up. You will reconnect briefly for updates in the next section, and you can stay offline for the scans themselves.
Save Your Personal Files, Not Programs
If you have important documents or photos that are not already backed up, copy them to an external drive now. Copy only your own data files (documents, pictures, music and videos). Do not copy programs, installers or files you do not recognize, because those are the ones most likely to carry the infection. Microsoft’s advice is that if you ever need to restore files after malware, you should restore only from backups made before the infection and stored outside the PC, such as in OneDrive. Treat anything you copy today as possibly unsafe until you have scanned it.
Check That Windows Security Is Actually Running
Open the Start menu, type Windows Security, and open the app. Select Virus & threat protection. If you see a message that another antivirus program is protecting the PC, Microsoft Defender Antivirus is not doing the scanning.
That is normal behavior, not a sign of malware by itself. Microsoft’s antivirus compatibility documentation explains that when a non-Microsoft antivirus product is installed on a Windows 10 or Windows 11 PC, Microsoft Defender Antivirus is disabled automatically. It can turn itself back on if that other product expires, is uninstalled or stops providing real-time protection. So if you have another antivirus, either run its full scan using that vendor’s instructions, or uninstall it so Defender takes over. Running two full real-time antivirus products at once is not a setup Microsoft recommends.
If no other antivirus is installed and protection is still off, check Manage settings under Virus & threat protection settings and turn Real-time protection on. If you had switched Defender off on purpose earlier, the steps in this walkthrough on turning off Windows Defender in Windows 11 also show where to turn it back on. If the toggle will not stay on, or the app refuses to open, skip ahead to the Safe Mode and offline scan sections.
Update Windows and Defender, Then Run a Quick Scan
An antivirus engine is only as good as its latest security intelligence (the definitions that describe known threats). Reconnect to the internet for this step only, and disconnect again when the updates finish.
- Open Settings, select Windows Update, and select Check for updates. Install what it offers and restart if asked.
- Open Windows Security and select Virus & threat protection.
- Under Virus & threat protection updates, select Protection updates, then Check for updates so Defender has the newest security intelligence.
- Go back to Virus & threat protection. Under Current threats, select Quick scan.
- Wait for the scan to finish. If it finds something, follow the actions Windows Security recommends for each item.
A Quick scan checks the places malware most often hides, such as memory, startup locations and common system folders. Microsoft suggests running one right away whenever you suspect malware, because it finishes fast and catches the most active threats. Treat it as a first pass, not the final word.
If one file or folder worries you (a download you just opened, for example), you can also scan it directly. Right-click it in File Explorer, select Show more options, and choose Scan with Microsoft Defender. For a plain-English walkthrough of the scan screens with more detail on each option, see how to run a Windows Defender scan on Windows 11.
Run a Full Scan or Custom Scan
After the Quick scan, run a deeper one. Here is the path:
- In Windows Security, select Virus & threat protection.
- Under Current threats, select Scan options.
- Choose Full scan to check every file and running program on the PC, or Custom scan to check only the drives and folders you pick.

- Select Scan now.
- Leave the PC plugged in and let the scan run. A Full scan can take an hour or more on a large drive. You can keep using the PC, but it will be slower.
Full Scan vs Custom Scan
Pick a Full scan when you do not know where the problem came from. Pick a Custom scan when you do know, for example an external drive you just plugged in, a USB stick a friend gave you, or the backup folder you created a few minutes ago. Scanning the backup before you trust it is a good habit, because a copied infected file is still an infected file.
Here is a worked example. Marcus notices his browser home page changed after he installed a free PDF converter. A Quick scan finds an adware item and removes it. He then runs a Full scan, which finds a second component in his Downloads folder. Finally, he runs a Custom scan on the USB drive he used to back up his tax documents, which comes back clean. That three-scan sequence takes about ninety minutes and gives him a clear answer about each location he cares about.
Run a Microsoft Defender Offline Scan for Stubborn Threats
Some malware hides from antivirus software while Windows is running. It may be a rootkit that loads early in startup, or a program that restores itself every time it is deleted. Microsoft recommends its offline scan when the same malware keeps coming back after normal scans.
The offline scan restarts the PC into a minimal environment outside your normal Windows session and scans from there, so the malware is not running and cannot defend itself. In current Windows Security, the option is listed under Scan options as Microsoft Defender Antivirus (offline scan). Some Microsoft documentation calls the same feature Microsoft Defender Offline scan.
Before You Start the Offline Scan
- Save your work. The PC signs you out and restarts. Close open documents first.
- Suspend BitLocker if it is on. According to Microsoft’s Defender Offline documentation, if you do not suspend BitLocker drive encryption first, you may be asked for the BitLocker recovery key when the PC restarts. Make sure you have that key before you begin.
- Check the hardware. The offline scan runs on x64 Windows 11 PCs. Microsoft does not support it on ARM devices.
- Defender must be the primary antivirus. If another antivirus is in control, the option will not work.
- Use an administrator account. Microsoft lists local administrator rights as a requirement for receiving offline scan updates, so sign in with an administrator account before you start.
- The Windows Recovery Environment must be enabled. If the offline scan fails to start, open Terminal as an administrator and run
reagentc /info. If it reports that the recovery environment is disabled,reagentc /enableturns it on.
Steps to Run the Offline Scan
- Open Windows Security and select Virus & threat protection.
- Select Scan options.
- Choose Microsoft Defender Antivirus (offline scan).
- Select Scan now, then approve the permission prompt.
- Windows signs you out and restarts. The scan runs on its own and usually takes about 15 minutes.
- When Windows starts again, sign in and check Protection history for the results.
If the scan found and removed something, run a normal Quick scan afterward to confirm nothing remains.
Get a Second Opinion With Microsoft Safety Scanner
A second scanner built by a different team can catch something the first one missed. Instead of downloading an unknown “cleaner” app (a common trojan disguise), use Microsoft’s own on-demand tool.
Microsoft Safety Scanner is a free, portable program that finds and removes malware. Key facts from Microsoft’s download page:
- It runs only when you start it. It does not install, does not add a Start menu entry and does not provide real-time protection.
- It expires 10 days after you download it. After that, download a fresh copy so it has current definitions.
- It supports Windows 11 and Windows 10.
- It does not replace your antivirus. Keep Microsoft Defender Antivirus, or another real-time product, running.
To use it:
- On a clean connection, open the Microsoft Safety Scanner page and download the version that matches your PC.
- Disconnect from the internet again if you prefer.
- Open the downloaded file (named
msert.exe) and accept the prompts. - Choose the most thorough scan it offers and start it.
- When it finishes, read the results screen. A detailed log is saved at
%SYSTEMROOT%\debug\msert.log(usually C:\Windows\debug\msert.log). - Delete the downloaded file when you are done, since it expires anyway.
If the download is blocked on the infected PC, download it on another computer, scan the USB drive you use to carry it over, and run it from there.
What the Malicious Software Removal Tool Does
You may see “Windows Malicious Software Removal Tool” in your update history. The Malicious Software Removal Tool (MSRT) is a separate Microsoft tool that is released monthly through Windows Update. It targets specific, widespread families of viruses, worms and trojans and removes them if they are active on the PC. It does not remove spyware, it needs an administrator account, and Microsoft describes it as a post-infection tool, not a replacement for antivirus. In practice, if Windows Update is working, MSRT is already running in the background each month. It is a safety net, not your main cleanup tool.
Review What Windows Security Found
Scans are only half the job. You also need to check what happened to each detection.
- In Windows Security, select Virus & threat protection.
- Select Protection history.

- Open each entry to see the threat name, its severity, the affected file and the action taken.
- If an item is waiting for a decision, follow the recommended action shown for it.
Items that Windows Security quarantined are locked away so they cannot run. Leave them there unless you are certain one is a false positive (a safe file flagged by mistake). Restoring a quarantined file that turns out to be malware undoes the cleanup.
Check Allowed Threats and Exclusions
Malware sometimes adds itself to the list of things Defender is told to ignore. Check both lists:

- On the Virus & threat protection page, look for Allowed threats. If anything is listed that you did not allow on purpose, select it and choose Don’t allow.
- Under Virus & threat protection settings, select Manage settings, then Add or remove exclusions. Remove any folder, file or process you did not add yourself.
Unexplained exclusions are a strong sign something tampered with your security settings. After removing them, run a Full scan again so the previously excluded locations get checked.
Why Not Delete Suspicious Files Yourself?
Older advice tells you to open the folder from a scan report and delete the file by hand. Windows Security already handles that through quarantine and removal, and doing it manually carries two risks. Malware often borrows the names of real Windows files, so you can delete a genuine system file by mistake. And many threats have several parts, so deleting the one file you can see may leave the rest. Let the scanners remove what they detect, and use the offline scan or a reset if something survives.
Start in Safe Mode if Malware Blocks the Scan
Safe Mode starts Windows with a minimal set of drivers and services. Many third-party programs, including a lot of malware, do not load there, which can let Windows Security open and scan when it otherwise would not. Microsoft’s malware troubleshooting page does not require Safe Mode, so treat it as a helper for a PC that is fighting back, not a mandatory step.
Microsoft’s Safe Mode instructions start from the Windows Recovery Environment. If you have never opened it, see how to boot into recovery mode in Windows 11.
Warning: if your drive uses BitLocker, have the recovery key ready before you start, because you may be asked for it.
- Open the Windows Recovery Environment.
- Select Troubleshoot, then Advanced options, then Startup Settings, then Restart.
- When the list of options appears, press 4 for Enable Safe Mode, or 5 for Safe Mode with Networking if you need internet access to download Microsoft Safety Scanner.

- Sign in, open Windows Security and run a Full scan.
- Restart normally when you are done.
Option 6 (Safe Mode with Command Prompt) is meant for advanced repairs and is not needed for a scan. Use Safe Mode with Networking only as long as you need the download, since it also lets any surviving malware reach the internet.
Clean Up Apps, Startup Items and Browsers
Scanners target code that is clearly malicious. Adware, browser hijackers and “potentially unwanted” programs often sit in a gray area, so you may need to remove them yourself through normal Windows settings.
Uninstall Programs You Did Not Install
Open Settings > Apps > Installed apps and sort the list by install date. Look for anything installed around the time the problems started, especially “PC optimizers”, “driver updaters”, browser add-ons and free utilities you do not remember choosing. Select the three dots beside the app and choose Uninstall. If you are unsure what a program is, search its exact name before removing it, because some entries with odd names belong to your PC maker or graphics driver. The full process is in this article on uninstalling a program on Windows 11.
Turn Off Suspicious Startup Apps
Go to Settings > Apps > Startup and switch off anything unfamiliar. Turning a startup item off is reversible, which makes it a safer first move than deleting. More options, including the Startup apps page in Task Manager, are covered in how to change startup programs in Windows 11.
Task Manager is also useful for spotting a process that keeps the processor busy while the PC is idle. Press Ctrl + Shift + Esc, or use one of the other methods in how to open Task Manager in Windows 11, and sort the Processes list by CPU. Right-click an unknown process and choose Open file location to see where it lives. A program running from a temporary folder or a randomly named folder deserves a Custom scan of that location.
Reset Your Web Browsers
Browser hijackers change your home page, search engine and new tab page, and they often install an extension that changes everything back if you only fix one setting. In each browser you use:
- Open the browser’s extensions page and remove every extension you do not recognize or no longer use.
- Check the startup page, home page and default search engine in the browser’s settings and set them back to what you want.
- If the changes return, use the browser’s reset option. Microsoft Edge and Google Chrome both include a reset settings option in their Settings pages. A reset turns off extensions and clears cookies and site data but keeps bookmarks and saved passwords.
If a browser is managed by your organization, a reset may not be allowed. In that case, contact your IT team.
How to Remove a Trojan From Windows 11
A trojan is the type of malware people most often ask about by name, and it needs a little extra attention because of what it does after it gets in.
What a Trojan Is
Microsoft’s description of trojans says they pretend to be harmless and often use the names of legitimate apps. Unlike a worm, a trojan cannot spread on its own. It arrives because someone downloaded it (a cracked game, a fake invoice attachment, a “free” tool) or because other malware installed it. Once running, a trojan may:
- Download and install other malware.
- Use the infected device to commit fraud.
- Record your keystrokes and the websites you visit.
- Send information about your PC, your passwords and your sign-in details to an attacker.
- Give an attacker control over your PC.
Signs a Trojan Is on the PC
Trojans try to stay quiet, so the signs are often indirect: security settings that change by themselves, new exclusions in Windows Security, accounts that sign in from places you have never been, password reset emails you did not request, or other malware that keeps reappearing after you remove it. That last sign matters most. If you keep removing adware and it keeps coming back, there is usually a trojan (often called a downloader) reinstalling it.
Steps to Remove a Trojan
Microsoft names the free Microsoft Defender Antivirus built into Windows 11 and Microsoft Safety Scanner as tools that detect and remove trojans, so the removal path is the same one used above, with the order tuned for a threat that may be watching:
- Disconnect from the internet so the trojan cannot send data or download more programs.
- Update Windows Security, then disconnect again.
- Run a Full scan in Windows Security.
- Run the Microsoft Defender Antivirus (offline scan), even if the Full scan was clean, because trojans are a common reason threats come back.
- Run Microsoft Safety Scanner as a second opinion.
- Check Protection history, Allowed threats and exclusions as described earlier.
- Remove unknown apps and startup entries.
- Change your passwords from a different, clean device (next section).
If a trojan detection names a “backdoor” or “remote access” threat, or if your bank or email provider reports suspicious activity, treat it as a sign that someone may have had access to the PC. That is the case where a full reset is often the safer choice.
Change Passwords and Secure Your Accounts
Because trojans and spyware are built to steal sign-in details, assume any password typed on the infected PC may be known to someone else. Do this from a different device you trust, such as your phone or another computer, so a surviving keylogger cannot record the new passwords.
- Change the password for your main email account first. Whoever controls your email can reset almost every other account.
- Change passwords for banking, shopping and payment accounts, then your Microsoft account and social media.
- Turn on two-step verification (multifactor authentication) wherever it is offered.
- Use each account’s security page to sign out of all other sessions and review recent sign-in activity.
- Watch bank and card statements for charges you do not recognize, and contact the bank right away if you see any.
Do not reuse an old password on any account. If the PC stored passwords in a browser, change those too, because browser-saved passwords are a common trojan target.
If It Is Ransomware
If your files were encrypted and a note demands payment, disconnect the PC immediately and do not connect any backup drive to it. Paying does not guarantee you get the files back. Restore from a backup made before the attack instead. Windows Security includes a ransomware protection feature called Controlled folder access, which protects chosen folders from unauthorized changes. Turn it on after the cleanup.
When to Reset or Reinstall Windows 11
Microsoft’s malware troubleshooting guidance recommends resetting the PC when malware has made changes that cannot be reversed. A reset is the most reliable fix because it replaces Windows instead of trying to repair it. Choose a reset when:
- Malware keeps coming back after a Full scan, an offline scan and Safety Scanner.
- Windows Security cannot be turned on or keeps switching off.
- A detection mentions a backdoor, remote access or a rootkit.
- Your system files are damaged and Windows behaves oddly even after the threats are gone.
- You simply want certainty, for example before selling or giving away the PC.
Open Settings > System > Recovery and select Reset PC. The full walkthrough, including how to start a reset from the recovery screen when Windows will not load, is in how to reload Windows 11 with Reset this PC. You will choose between two options:
| Option | What it keeps | When to pick it |
|---|---|---|
| Keep my files | Your personal files; apps and settings are removed | Ordinary adware or a single detected threat that is now gone |
| Remove everything | Nothing; the drive is wiped and Windows reinstalled | Trojans, backdoors, ransomware or repeated reinfection |
You will also choose how to get Windows: Cloud download fetches a fresh copy from Microsoft, while Local reinstall uses files already on the PC. After an infection, Cloud download is the cleaner choice because it does not rely on files the malware could have touched. Have your BitLocker recovery key ready before you start. For a full clean install with installation media, see how to wipe and reinstall Windows 11.
After the reset, reinstall apps from their official sources, not from old installers you saved, and restore personal files only from a backup you trust.
Confirm the Malware Is Gone
Before you declare victory, check these points over the next few days:
- A fresh Full scan finishes with no threats found.
- Protection history shows no new detections.
- Real-time protection stays on after restarts.
- Your browser’s home page and search engine stay the way you set them.
- No unknown apps or startup items reappear.
- Your accounts show no new unrecognized sign-ins.
If all of these hold for a week, you can be reasonably confident the cleanup worked. If anything returns, go straight to the offline scan and then to a reset with Remove everything.
Keep Malware From Coming Back
Most infections start with something the user downloaded or opened. These habits make a repeat far less likely: Leaving SmartScreen’s app and file checks switched on helps catch those downloads before they run.
- Keep Windows and your apps updated. Updates close the security holes that malware uses to get in.
- Leave Real-time protection on. If you turn it off temporarily, Windows turns it back on automatically after a short time.
- Leave Tamper protection on. Found under Virus & threat protection settings, it helps stop malicious apps from changing important Defender settings. Microsoft notes that you must turn Tamper protection off before you can turn off Real-time protection, which is exactly the kind of barrier you want malware to hit.
- Look at Smart App Control. In Windows Security, open App & browser control to see whether Smart App Control is available on your PC. It only lets apps run if they come from known publishers or Microsoft’s app intelligence service predicts they are safe, which helps block suspicious software such as many trojans.
- Download software from the developer or the Microsoft Store. Avoid cracked software, key generators and “free” versions of paid apps; they are a leading way trojans arrive.
- Be suspicious of attachments. An unexpected invoice, delivery notice or shared document that asks you to enable content or run a file is a classic trap.
- Use a standard account for everyday work. Many installers need administrator approval, so a prompt you did not expect is a useful warning.
- Back up regularly to a location that is not always connected. OneDrive or an external drive you plug in only for backups gives you a clean restore point if anything gets through.
Questions About Malware Cleanup on Windows 11
Can Windows Security remove a trojan on its own?
Often, yes. Microsoft lists Microsoft Defender Antivirus, which is what Windows Security uses, as a tool that detects and removes trojans. No scanner catches everything, though, which is why this process adds the offline scan and Microsoft Safety Scanner, and falls back to a reset when a threat will not stay gone.
Do I need to pay for another antivirus?
Not to follow these steps. Every tool used here is free and from Microsoft. If you do install another antivirus later, expect Microsoft Defender Antivirus to switch itself off while that product is active, and make sure you keep the other product’s subscription current.
Is Safe Mode required to remove malware?
No. Microsoft’s own malware guidance relies on the offline scan rather than Safe Mode. Safe Mode is useful when malware stops Windows Security from opening or scanning in a normal session.
Will a full scan delete my personal files?
Windows Security only acts on items it detects as threats. If one of your own files is infected, it may be quarantined, so check Protection history before assuming a file is lost. A file that is quarantined by mistake can be restored from there.
Does a factory reset remove all malware?
A reset with Remove everything and Cloud download wipes the drive and puts a fresh copy of Windows on it, which is why Microsoft points to a reset when malware has made changes that cannot be undone. The catch is your backups: if you restore an infected file or reinstall the same bad download afterward, the problem returns, so scan what you restore.
My scans are clean but the PC is still slow. Now what?
Then the slowness probably is not malware. Check storage space, pending updates and startup apps, and look in Task Manager for the program using the most memory or processor time.
Once your scans come back clean and your passwords are changed, reconnect to the internet, run Windows Update one more time, and then let Windows Security handle protection in the background.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are checked step by step against the device or app maker’s own documentation and tested on his own devices whenever he has the hardware or software, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.