Due to their portability, USB devices are prone to spreading viruses. USB drives are particularly susceptible to two main types of viruses: shortcut viruses and autorun viruses. In this article, we will discuss how to eliminate viruses using anti-malware programs or manual command inputs. Learn about the measures Windows is implementing to protect computers from autorun viruses.
Steps
Removing Shortcut Viruses

Understanding Shortcut Viruses. Shortcut viruses come in two forms. The first type replaces folder and file icons on your computer with shortcut icons—icons featuring a small arrow in the lower-left corner, labeled 'shortcut,' and/or with the 'shortcut.exe' extension. The second type affects USB drives or pen drives. This variant hides all files on the USB in a hidden folder and creates a 'shortcut.exe' file on the drive. Opening these files activates the virus, allowing it to spread to your computer.

Remove shortcut viruses using antivirus software. If your USB is infected with a shortcut virus, you can eliminate the malicious threat using antivirus software. Navigate to Start > My Computer. Right-click on the removable drive and select 'Scan for Viruses.' Follow the on-screen instructions to remove the shortcut virus.
- If you're using Windows RT 8.1 or later, your computer comes equipped with Windows Defender. Launch Windows Defender and go to Settings > Advanced. Check the box for 'Scan removable drives.' Every time you perform a full scan, the USB will be checked for viruses.
- If your computer lacks antivirus software, download a reputable anti-malware program.
- Only download and install one anti-malware program.

Eliminate shortcut viruses using Command Prompt. You can remove viruses from a flash drive using the Command Prompt window. To open Command Prompt, click 'Start' and type 'cmd.' Click 'cmd' or 'Command Prompt Window' from the results and select 'Run as Administrator.' In the Command Prompt window:
- Enter the USB drive letter and press ↵ Enter. To identify the USB drive letter, open 'My Computer' and note the letter next to the removable drive.
- Type del *.lnk and press ↵ Enter.
- Type attrib -s -r -h *.* /s.d/l/ and press ↵ Enter.
- Open the flash drive. All files will return to their normal state.

Back up your files. After removing the virus, you can format the drive. Formatting the USB will erase all data stored on it, ensuring the device is clean and virus-free. Before formatting, back up all files on the USB. Scan the entire contents of the pen drive and delete any unfamiliar folders or files. Transfer all files from the USB to a folder on your computer.

Reformat the drive. Click 'Start' and type 'cmd' in the search bar. Launch the 'Command Prompt Window.' Enter the drive letter corresponding to the USB and press ↵ Enter. Type format /q /x [DRIVE LETTER]: and press ↵ Enter. Transfer all files back to the USB.
Removing Autorun Viruses

Understanding Autorun Viruses. In the past, when you plugged a USB into your computer, the drive would automatically open. If the USB was infected, this process would execute the autorun.inf file containing the autorun virus, thereby activating it. However, USB devices no longer auto-open on Windows XP, Windows 7, Windows 8, or Windows 10, meaning the autorun.inf file won’t execute automatically. This measure helps protect computers from such viruses.

Scan the Drive for Viruses. Always scan your pen drive before use. Navigate to Start > My Computer. Right-click on the removable drive and select 'Scan for Viruses.' If a virus is detected, follow the instructions to remove it.
- If you’re using Windows RT 8.1 or later, your computer comes with Windows Defender. Open Windows Defender, click Settings > Advanced, and check the box for 'Scan removable drives.' Every full scan will include the USB drive.
- Some anti-malware programs automatically scan USB drives when connected to your computer.
- If your Windows computer lacks antivirus software, download and install a reputable program.

Removing Autorun Viruses. To eliminate autorun viruses from a removable drive, delete the autorun.inf file and restart your computer.
- Click Start > Run.
- Type 'Cmd' and press ↵ Enter.
- In the Command Prompt window, type the drive letter and press ↵ Enter.
- Type attrib -r -h -s autorun.inf and press ↵ Enter.
- Type del autorun.inf and press ↵ Enter.
- Restart your computer after completing the process.
Haris Shafi.
HARIS SHAFI
HARIS SHAFI HARIS SHAFI facebook: [[1]]
Tips
- Always scan your computer after completing the steps above, as viruses can spread from the USB storage device to the main drive.
- Scan all files you intend to copy to your computer to ensure they are safe and virus-free. If a favorite photo is infected, print it before deleting, then scan it back into your computer. You’ll thank yourself later.
Warnings
- Any file you copy could be infected. If you cannot afford to lose a document or photo, print it first and then scan it back into your computer.
