On this page, we provide four practical methods to help you remove viruses and recover deleted or lost files with powerful data recovery software tools. If you find yourself in this predicament, follow the solutions outlined here to cleanse your system of viruses and restore your files:
Please provide the English content you want to translate, and I'll promptly translate it into Chinese for you.
Effective Solutions | Stepwise Troubleshooting |
---|---|
Solution 1. Remove Virus Using CMD | Run Command Prompt as an administrator or use M Tool > Type attrib -s -h -r /s /d *.* to clear the virus...Full Steps |
Solution 2. Run Antivirus Software | Run your installed antivirus software and perform a cleanup if a virus is detected...Full Steps |
Solution 3. Run Windows Defender | Go to Settings > "Update & Security" > "Windows Security" > "Virus & threat protection"...Full Steps |
Solution 4. Format Infected Device | If a hard drive partition or external storage device is infected, formatting might help...Full Steps |
We all hate computer viruses, right? No question about it. But do you know how they actually mess with your computer? Well, there are lots of different types, and they behave in different ways, but, basically, a computer virus is a program that makes your computer do things you don't want it to. Some are designed to destroy your computer, delete important files, track what you do online, or give hackers access to your personal information. They're just plain nasty. Ransomware like Locky and CryptoLocker delete and encrypt your files, even changing the file extension to .locky or .encrypted. Others hide your files so you can't find them, and seem impossible to un-hide.
Though CMD commands can help remove virus, they cannot restore files that have been damaged or lost due to virus infection. A Data Recovery Wizard tool can recover lost data in various severe situations.
Follow the guide below to learn the three-step file recovery method.
Step 1. Select the virus-infected disk to scan
Run an antivirus file recovery software on your Windows PC. Select the disk that was infected by the virus to scan for lost or hidden files. Note that:
Step 2: Review all scan results
The "Data Recovery Wizard" tool will immediately start scanning the virus-infected hard drive to find deleted or hidden files. To quickly locate the file you need, use the "Filter" or "Group by Type" feature to display only images, videos, documents, emails, and so on.
Step 3: Preview and recover the deleted/hidden files
Once the scan is finished, you can preview the files that were found. Select the ones you want, then click “Recover.” Save the recovered files to a safe location on your computer or storage device, not the original location where they were lost.
Indeed, once you detect a virus, you would want to get rid of it. Among many options, several users try deleting a virus using CMD.
Actually, using the Command Prompt doesn't directly scan and remove viruses from your computer or external storage device. It helps you achieve the goal of virus removal by showing hidden viruses on disk partitions or drives. You can then delete suspicious files. Since viruses always hide themselves, you need to reveal them so that you can delete the virus files. How do you display potential hidden virus files using CMD? All you need is the attrib command.
The `attrib` command is a Command Prompt utility used to view, set, or remove the attributes of a file or folder at a specified location. By un-hiding the virus's "hidden" attribute, you'll be able to see it within your folders. You'll then know where to find and delete it.
Now, follow the steps below to remove the virus from your computer or storage device using CMD:
Step 1: Type cmd in the search bar, right-click on "Command Prompt," and select "Run as administrator."
Step 2. Type F: and press 'Enter' key. (Replace "F" with the letter designating the infected partition or drive.)
Step 3: Type attrib -s -h -r /s /d *.* and press "Enter."
Step 4. Type dir, and press "Enter". You will now see all the files on that drive. (The dir command displays a list of files and subdirectories in a directory.)
The name of the virus may contain the word "autorun," and the file extension will be ".inf." If you find such a suspicious file, type del autorun.inf to remove the virus.
Here are the basic attributes of the `attrib` command:
R - denotes the "Read-only" attribute of a file or folder, meaning it cannot be written to or executed.
H - stands for the "Hidden" attribute.
A - represents the "Archive" attribute, used to prepare files for archiving.
S - the "System" attribute, which changes selected files or folders from user files to system files.
I - indicates the "Not Content Indexed" attribute.
"Attrib" Syntax:
ATTRIB [+attribute | -attribute] [filename[and path] [/S [/D]]
In the command above, let's examine what each of the parameters and flags mean:
'+ / -': Enables or disables the specified attribute.
'attribute': As mentioned above.
: Searches the entire path, including subfolders.
'/D': Includes any folder that contains a process.
< strong>'pathname': The path to the target file or folder.
Here is the correct syntax order for the attrib command:
ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [+I | -I] [drive:][path][filename] [/S [/D] [/L]]
If you receive a “Permission denied” message, you should:
Manual execution at the command prompt is more suitable for computer experts, as incorrect commands can do more harm than good. For safety and ease of use, we highly recommend trying an automated command-line alternative, such as CleanGenius. This utility allows you to check and fix file system errors, enable or disable write protection, and update your system with a single click, without the need to type complex command lines.
To reveal hidden files using this one-click repair tool, simply follow these easy steps.
Step 1: Download the free CleanGenius tool.
Step 2: Launch CleanGenius, and then choose “Optimize” from the left panel. Next, click “File Display” on the right.
Step 3: Select the hard drive and click 'Execute'.
Step 4: After you finish the Folder Options setup, click on this link to view the hidden files.
Aside from using CMD, you can remove viruses from your computer or storage device using antivirus software, Windows Defender, or by formatting the storage device.
Almost every computer has antivirus software installed. Running this when you suspect an infection can be helpful. We recommend using TotalAV, a powerful antivirus and security program that can quickly scan your system and protect your computer.
Please provide the English content you want to translate, and I'll translate it into Chinese for you.
TotalAV is an award-winning antivirus and security software that provides real-time protection against viruses, malware, and online threats.
Activate Antivirus Protection
Windows Defender Antivirus is the built-in antivirus protection for Windows 10 and 11. It protects your computer and connected devices from viruses, malware, and spyware. If you don't have a third-party antivirus, it's wise to use the built-in tool.
Step 1: Go to Settings > Update & Security > Windows Security.
Step 2. Click on Virus and threat protection.
Step 3: In the 'Threat History' tab, click on 'Scan Now' to scan for viruses on your computer.
Formatting refers to deleting the existing files on a selected partition or drive. This will, of course, get rid of the virus. However, since formatting a partition/drive results in data loss, make sure there are no important files stored on the device.
In addition to knowing how to deal with a virus attack, you should also know how to protect your computer or external storage device from getting infected in the first place. To better safeguard your computer or USB drive, here are some antivirus tips you can follow:
Install professional antivirus software on your computer and keep it up to date. Be cautious about the sources of programs you intend to install. Avoid visiting suspicious websites; think twice before clicking. Ensure your internet connection is secure. Additionally, it's recommended to back up your files regularly using free backup software to prevent data loss in case of a virus infection.
Using CMD to delete a virus is an indirect method, but it can work sometimes. If the "attrib" command doesn't work, try the other three methods to remove the malicious file. Besides, a virus attack often comes with data loss. In this case, you should use a hard drive recovery tool, like Data Recovery Software, as soon as possible to rescue your lost files.
Do you have more questions about using CMD to remove viruses? Keep reading, and you'll learn more.
How do I remove the Shortcut Virus?
We'll recommend five methods to help you get rid of the Shortcut virus:
How do I remove hidden viruses from my computer?
You can use built-in Windows tools to remove hidden viruses:
How can I tell if my computer has hidden viruses?
There are signs that your computer may have a hidden virus: