4 Easy Ways to Remove Virus from Your Flash Drive
Flash drives are one of the most convenient storage options. They're small and easy to carry around, making it simple to transfer data. Even though external hard drives are becoming more popular, flash drives are still widely used, especially for transferring smaller files.
Since flash drives are so commonly used, it’s no surprise that viruses, worms, or trojans are often spread through them. This is because flash drives are frequently moved between different computers.
Viruses on flash drives usually affect the files, making them unreadable when opened. Some viruses also create random shortcuts that appear on your flash drive or computer.
If your flash drive gets infected with a virus, don’t worry! In this article, Carisinyal will show you some simple ways to clean your flash drive from viruses.
1. Scan with Antivirus Software
Viruses can always be dealt with using antivirus software, especially if your antivirus is up-to-date. Whenever you plug your flash drive into your computer, it's a good idea to scan it with antivirus software.
You can choose from many excellent antivirus programs. Here’s how you can scan and clean a virus using antivirus software:
1. Open the antivirus software

Run the antivirus program installed on your computer. In this example, we’re using Avast. Once the software is open, plug your flash drive into the USB port.
Look for the option to scan external devices or removable drives. In Avast, go to the 'Protection' section, then click on 'Virus Scans.'
You can choose the 'Smart Scan' option for an automatic scan of directories that might contain a virus, or you can select 'Targeted Scan' to scan your flash drive specifically.
2. Start the scan

Click on 'Scan' or 'Start Scan' to begin. Make sure your antivirus has the latest virus definitions to catch the newest threats.
The time it takes to scan will depend on the size of your flash drive and the number of files it contains.
3. Remove the Virus
Once the scan is complete, the antivirus will show you a list of infected files. You can choose to clean or remove the virus from your flash drive. Some antivirus programs also let you quarantine the infected files, isolating them so they can't spread the virus or damage your system.
2. Removing Viruses with CMD

Flash drives are often targeted by viruses that create many shortcuts. These types of viruses can’t be deleted by just pressing “del” or “shift+del.”
Instead, they display your files as shortcuts while hiding your actual data. Though it may seem harmless, this virus is pretty annoying because it hides your important files.
To remove this kind of virus, you don't need antivirus software. You can use a simple command in the Command Prompt (CMD).
This will get rid of the virus without losing your important data and also make hidden files visible again. Follow these steps to remove the virus using CMD:
- Press the Windows key + R to open the Run window.
- Type “CMD” and press Enter to open Command Prompt.
- In the Command Prompt window, type f: (replace f: with the letter of your flash drive) and press Enter.
- Type the command attrib -s -r -h . /s /d /l and press Enter. This will remove the hidden, read-only, and system attributes from all files on the flash drive.
- Type del autorun.inf and press Enter to remove the autorun.inf file that may contain the virus.
If your flash drive is on a different partition, be sure to change the drive letter in step 3 to match your flash drive’s partition.
After completing these steps, check your flash drive. Your data should reappear. The virus is still present, but now you can delete it. We recommend moving your important files off the flash drive first, then formatting it to ensure it’s completely clean.
3. Removing Viruses Using Linux

You can remove a virus from your flash drive without using antivirus software. To do this, you’ll need to use a different operating system, and the easiest way is by using Linux.
There are many small-sized Linux distributions that can be installed on a flash drive, allowing you to boot directly from the flash drive with Linux. So, why remove the virus using another operating system?
The reason is simple: viruses usually target Windows operating systems. This means that a virus on your flash drive will only be active when connected to a Windows computer. With Linux, you can easily remove the virus from your flash drive without the risk of infecting your Windows system.
4. Format Your Flash Drive

If the virus infection is severe or you just want to make sure your flash drive is completely clean, formatting it is an option. Keep in mind that formatting will erase all the data on the drive, so only do this as a last resort.
There are several ways to format a flash drive. Here’s how to do it through File Explorer:
- Connect the flash drive to your computer.
- Open File Explorer and find your flash drive.
- Right-click on the flash drive and select “Format.”
- In the Format window, choose the file system (usually NTFS or FAT32).
- You can name the drive (optional).
- Uncheck the “Quick Format” option if you want a full format.
- Click “Start” to begin the formatting process.
These are some of the ways you can remove viruses from your flash drive. Once it’s clean, don’t forget to scan your flash drive for viruses every time you connect it to your computer.
By keeping your flash drive clean and secure, you can reduce the risk of virus infections and protect your important data.
