I'm using Windows 11, and Command Prompt windows have started appearing on their own. Windows Defender detected malware, so I removed it and restarted the computer, but the Command Prompt windows appeared again during startup. How can I tell whether the infection is still active, and what steps should I take to secure the PC?
4 Answers
If a security tool’s download reports that the virus scan failed, don’t keep using the possibly compromised computer to download more tools. Disconnect it from the network and perform the scans from trusted bootable rescue media, or proceed with a clean Windows installation. Afterward, update Windows, enable Defender, reinstall applications from official sources, and change passwords from a separate device.
Not every Command Prompt window means malware. Check Task Manager’s Startup apps and the Event Viewer to identify what launches it. Printer utilities, audio drivers, update tools, and other legitimate software can briefly open a command window. Still, because Defender detected malware, run a second-opinion scanner such as Malwarebytes if you can obtain it safely.
Disconnect the computer from the internet immediately, then use a different trusted device to change important passwords. The safest approach is a clean Windows installation that erases the existing system rather than preserving files or programs. Back up only personal documents you’re confident are safe, and scan them before restoring them.
A clean installation is the most reliable way to remove a suspected persistent infection. You’ll need a USB flash drive and another working computer to create Windows 11 installation media, then boot the affected PC from that USB and delete the existing Windows partitions during setup. Make sure important files are backed up first, because this removes data and applications.

Do I need a USB drive, and where do I get the Windows installer for it?