Now somehow your Pen drive gets infected by computer viruses, it will change the attribute of all existing files or folders. Therefore, you will be in real trouble in such a situation as you won’t be able to access your important files or folders.
You can use any Antivirus application for Windows 10 like Avast, Norton, etc. to remove those viruses from your Pendrive. However, you can also remove those viruses manually(Without using Antivirus application).In this article, I will show you how to remove viruses from Pendrive manually or you can say that how to remove viruses from Pendrive using Command Prompt on Windows 10.
How To Remove Computer Viruses From Pen drive Using Widows 10 Command Prompt:
Before further proceeding let me tell you one thing i.e. using Antivirus is highly recommended method for removing viruses from Pen drive. This tutorial is only for knowledge purpose. So let’s start.
To remove viruses from Pen drive using Windows 10 command prompt, we have to perform two tasks:
- Virus detection using Command Prompt
- Remove Virus using Command Prompt
Detect Viruses Using Command Prompt:
- Connect the Pen drive with PC.
- Run Command Prompt as an administrator
- Type Pen drive location for selecting the particular drive. In my case, the location of the Pendrive is ‘F’ so I am going to select ‘F’ drive by typing F: and then press Enter.
Remove Viruses Using Command Prompt:
Now you have the list of viruses present in Pen drive. However, you cant able to find or delete those viruses due to their Hidden and Read-only attributes. Therefore, you need to remove these attributes first to delete them. For this type, the command given below.
attrib -h -r -s -a *.* and press Enter.
- h represents the hidden attribute
- r represents the read-only attribute
- s represents system file attribute
- a represents archive attribute
- *.* represent all the files with all different types of file extensions.
- ‘-‘ represent removing an attribute
Now, you will be able to find and delete those viruses by opening the Pen drive. You can delete these viruses either by pressing “Delete” key or by using commands. To delete those viruses using command prompt, type del [file location filename] on the command prompt and press enter. For example, del C:svchost.exe and press Enter.