Delete viruses using Command Prompt(with images) Recycler folder
Command Prompt is a command line interface introduced by Microsoft in all their operating systems to help the user interact with the operating system using specific commands. These are similar to the old DOS commands that were used to operate computers of older times. These days, viruses take the help of Removable drives to propagate from one system to another. An autorun.inf is added along with the virus with the help of which the virus is activated once the removable disk is inserted into a system. In order to prevent this from happening, the Command Prompt can be used to delete the viruses present in the disk. Here are a few instructions to delete these malicious files from any removable drive even if the files are in the Recycler folder.
Follow these instructions before opening the drive. This means don't open it even with the Explore option.
Follow these instructions before opening the drive. This means don't open it even with the Explore option.
- Open the Command Prompt by typing
cmd
in the Run box.
- In the Command Prompt, type
[drive_letter]:
(for example F:) followed by return.
- Once the Command Prompt is in the specified drive, type
dir /w/a
.
- All the files including the hidden ones are shown by the Command Prompt. It looks something like this
- Identify the autorun.inf and the virus in the directory. I had a Newfolder.exe in my drive.
- Use the command
attrib -r -a -s -h
to remove the attributes of all the files in the directory.
- Type the command
del autorun.inf
to delete the autorun file first.
Now typedel [Name_of_the_virus].exe
to delete the virus.
- You got rid of that virus. But sometimes, there is a possibility of the virus residing in the Recycler folder. To delete these files, you'll have to navigate to the folder by using the
cd recycler
command.
- By using
dir /w/a
, you can check the files present in that folder. Files with weird names such as the one I had must be deleted.
- Now remove the attributes of the files by following step 6 again and delete the virus with the command
del [file_name].exe
.
- Wasn't that easy? This way, you can still be safe while importing files from a removable disk to your computer.