Do you know you can use commands to remove virus? This post from MiniTool Partition Wizard shows you how to use CMD to remove virus and tells you the disadvantage of this method.
How to Remove Virus Using CMD
Can you use CMD to remove virus? The answer is YES, but the work is difficult for most people. CMD offers commands to display all types of files, including hidden ones. However, it can’t identify what file is a virus. You need to find the virus file by yourself and then delete it. Here is the guide:
- Type “cmd” in the Windows Search bar.
- Right-click Command Prompt from the result list and choose Run as administrator.
- In the Command Prompt window, type “Drive_Letter:” (f: for example) and press Enter. You will go to the drive where you suspect there is a virus.
- Type “attrib -h *.*” and press Enter. This command will delete the hidden attribute of all files under the drive. Hence, all hidden files are shown.
- Type “dir” and press Enter. This will display all of the file directories (files and folders) on the drive.
- Check whether there is an autorun.inf file or other virus files. If you find it, you can type “del file_name” and press Enter to delete this virus.
Further Reading:
You can also show hidden files in File Explorer and then find the virus to delete. Here is the guide:
On Windows 10
- Open File Explorer by clicking its icon on the taskbar.
- Click File in the left upper corner and choose Change folders and search options. A Folder Options window will pop up.
- Skip to the View tab and check Show hidden files, folders, and drives.
- Click the Apply and the OK buttons.
On Windows 11
- Open File Explorer.
- On the ribbon section, click View > Show > Hidden items.
How to Remove Virus Using Antivirus
If you use CMD to remove virus manually, this is very inconvenient. The most commonly used way is to run an antivirus. Windows Defender is the built-in antivirus protection in Windows 10/11. You can run it to delete viruses. Here is the guide:
On Windows 10
- Press the Windows key + I to open Settings.
- Click Update & Security.
- Click Windows Security in the left panel and click the Open Windows Defender Security Center button in the right window.
- Go to Virus & threat protection and click Quick Scan.
On Windows 11
- Open Settings.
- Click Privacy & Security on the left and click Windows Security on the right.
- Click Open Windows Security.
- Go to Virus & threat protection and click Quick Scan.
Bottom Line
MiniTool Partition Wizard is a functional tool. It can migrate OS, clone disk, recover partitions, recover data from hard drive, etc. If you have this need, download it to have a try.
MiniTool Partition Wizard DemoClick to Download100%Clean & Safe