If you’re here, it’s probably because your computer is crawling with pesky viruses. What’s worse?
Those sneaky viruses might have even disabled your antivirus software, leaving you stuck and frustrated.
Don’t worry; I’ve got your back! In this guide, I’ll show you how to clean your computer using the Command Prompt. It’s simple, effective, and doesn’t require any fancy tools. Let’s dive in!
Step 1: Open the Command Prompt as Administrator
The first step is to access the Command Prompt (also known as CMD) with administrator privileges. Here’s how:
-
On Windows 10:
- Right-click the Start Menu or press the Windows + X keys.
- From the menu, select Command Prompt (Admin).
-
On Windows 11:
- You won’t see the “Command Prompt” option directly. Instead, select Terminal (Admin).
- When the terminal opens, it defaults to PowerShell. Click the small down arrow in the top bar and choose Command Prompt while holding the Ctrl key.
-
Grant Permissions:
- A User Account Control (UAC) prompt will appear. Click Yes to allow changes.
And there you go! The Command Prompt is now open as an administrator.
Step 2: Identify Suspicious Processes
Viruses often run as background processes, so let’s track them down. Follow these steps:
-
In the Command Prompt, type:
tasklist
Press Enter to display a list of all running processes on your PC.
-
Carefully examine the list for any suspicious processes. These might have weird names, seem unfamiliar, or stand out in some way.
Pro Tip: If you’re unsure about a process, you can always Google its name to check if it’s legitimate.
Step 3: Stop Virus Processes
Once you’ve identified the suspicious processes, it’s time to stop them. Here’s how:
Stopping a Process by Name
-
Type the following command:
taskkill /IM [ProcessName] /F
Replace
[ProcessName]
with the exact name of the process you want to stop. For example:taskkill /IM virus.exe /F
-
Press Enter, and the process will be terminated.
Stopping a Process by Process ID
If the process name is too long or hard to type, use its Process ID (PID) instead:
-
Note the PID of the suspicious process from the tasklist.
-
Type:
taskkill /PID [ProcessID] /F
Replace
[ProcessID]
with the actual number. For example:taskkill /PID 1234 /F
-
Press Enter, and the process will stop.
Step 4: Scan Your PC Using Windows Defender via CMD
Now that the virus processes are terminated, it’s time for a proper scan using Windows Defender. Here’s how to do it:
-
Navigate to the Defender Directory:
Copy and paste the following command into the Command Prompt:cd C:\ProgramData\Microsoft\Windows Defender\Platform\latest
Press Enter.
-
Run a Quick or Full Scan:
Use the following command for a scan:MpCmdRun.exe -Scan -ScanType [ScanType]
Replace
[ScanType]
with one of the following:- 1 for a quick scan
- 2 for a full system scan
For example, if you want a quick scan, type:
MpCmdRun.exe -Scan -ScanType 1
-
Scan Specific Files or Folders:
If you want to scan a particular file or folder, type:MpCmdRun.exe -Scan -ScanType 3 -File [FilePath]
Replace
[FilePath]
with the full path to the file or folder. -
Wait for the Scan to Complete:
The process might take some time, especially for a full scan. Be patient and let it finish.
Step 5: Perform an Offline Scan (Optional but Recommended)
Some stubborn viruses require an offline scan. This method restarts your computer and runs a more thorough scan. Here’s how:
-
Open PowerShell as an administrator.
- Search for PowerShell in the Start Menu, right-click, and choose Run as Administrator.
-
Enter the following command:
Start-MpWDOScan
-
Press Enter. Your PC will restart, and the offline scan will begin automatically. Let it do its job, and when finished, your PC will boot up again.
Step 6: Disable Suspicious Startup Items
Viruses often configure themselves to start every time your PC boots. Let’s disable them:
-
Open Task Manager:
In the Command Prompt, type:taskmgr
Press Enter to open the Task Manager.
-
Navigate to the Startup Tab:
In Task Manager, go to the Startup tab. -
Identify and Disable Suspicious Items:
- Look for any unusual or unfamiliar programs listed here.
- Right-click on the suspicious app and select Disable.
By doing this, you ensure that these programs won’t automatically run when your PC starts up.
Step 7: Stay Safe and Secure
Congratulations! You’ve successfully cleaned your PC using the Command Prompt. Here are a few final tips to keep your computer virus-free:
- Install a Reliable Antivirus: Keep your antivirus program updated and running at all times.
- Avoid Suspicious Downloads: Be cautious about the files and programs you download, especially from untrusted sources.
- Keep Your System Updated: Regular Windows updates often include important security patches.
That’s it! If you found this guide helpful, don’t forget to share it with your friends who might need a little tech support.