To scan a USB drive for viruses in Windows 10 or 11, plug it in, open File Explorer, right-click the drive under This PC and choose Scan with Microsoft Defender (on Windows 11, click Show more options first). Do this before you open any files on the drive, and if anything is found, let Windows Security remove it before copying files across.
USB sticks, external hard drives and memory cards move between computers, so they can carry malware from one PC to the next. A quick scan each time you use an unfamiliar drive is a simple, worthwhile habit.
Before you plug it in: switch off AutoPlay
AutoPlay can open a drive or offer to run something as soon as it is connected. Turning it off gives you a chance to scan first.
- Windows 11: open Settings > Bluetooth & devices > AutoPlay.
- Windows 10: open Settings > Devices > AutoPlay.
- Turn off Use AutoPlay for all media and devices, or set Removable drive to Take no action.
Method 1: Right-click scan with Microsoft Defender
- Plug in the USB drive and wait for Windows to recognise it.
- Open File Explorer and click This PC.
- Right-click the USB drive (for example USB Drive (E:)).
- On Windows 11, click Show more options, then Scan with Microsoft Defender. On Windows 10 the option appears straight away.
- Windows Security opens and shows the results. If threats are found, click Start actions to remove or quarantine them.
Method 2: Custom scan in Windows Security
This gives you the same scan but lets you choose the drive from inside Windows Security.
- Open Settings > Privacy & security > Windows Security (Windows 10: Settings > Update & Security > Windows Security) and click Virus & threat protection.
- Click Scan options, choose Custom scan and click Scan now.
- Select the USB drive and click Select Folder.
Method 3: Scan automatically when a drive is connected
By default Microsoft Defender's full scans skip removable drives. If you use many external drives, you can include them in full scans using PowerShell run as administrator:
Set-MpPreference -DisableRemovableDriveScanning $false
This only affects full scans; you should still right-click scan a new drive before opening files on it. Real-time protection will also check files as you open or copy them.
What to look for on the drive, even after a clean scan
Scanners rely on known patterns, so it is worth a quick manual check too. First turn on file extensions (View > Show > File name extensions in Windows 11, or the File name extensions box on the View tab in Windows 10) and hidden items.
| What you see | Why it is suspicious |
|---|---|
Shortcuts (.lnk) with folder names, while the real folders are hidden | Classic USB worm behaviour; the shortcut runs malware and then opens the folder |
An autorun.inf file you did not create | Old technique to launch programs automatically |
Files such as photos.jpg.exe | A program disguised as a document. See double-extension files |
Unknown .exe, .vbs, .js or .bat files in the root of the drive | Scripts and programs rarely belong on a photo or document stick |
| Your files suddenly have strange extensions and won't open | Possible ransomware. See ransomware warning signs |
If the drive is infected
- Let Windows Security remove or quarantine the threats, then scan the drive again.
- Scan the computer the drive came from, if you can, and your own PC with a Full scan. If you opened files from the drive before scanning, also run a Microsoft Defender Offline scan.
- Copy only the files you need (documents, photos) and avoid running any programs from the drive.
- For complete peace of mind, back up the clean files elsewhere and reformat the drive: right-click it in File Explorer and choose Format. This erases everything on it.
If threats keep coming back, follow how to remove a virus from Windows.
How Threat Eraser scans USB drives
Threat Eraser is a virus and malware scanner and remover that can check any USB stick, external drive or folder. Use File > Scan a Folder… or Custom Scan… and pick the USB drive, or drag the drive or a folder from it onto the Threat Eraser window. It checks files against virus signatures, malware detection rules, and known malware hashes, looks inside ZIP archives, and flags disguised names such as double extensions and hidden right-to-left characters. Nothing is uploaded: files are scanned on your PC, and definitions update every time Threat Eraser starts.
With a license you can quarantine and erase detections, and add Scan with Threat Eraser to the Explorer right-click menu so checking a drive is one click away. If you regularly copy files from external drives into Documents or Desktop, Real-Time Watch will also scan those new files automatically as they arrive.
Find out more about the Threat Eraser virus scanner.
Frequently asked questions
Can a virus run just by plugging in a USB drive?
Modern Windows no longer runs programs automatically from USB drives, but malicious shortcuts and files can still run when you open them.
Does formatting a USB drive remove viruses?
A full format erases the files on the drive, including malware, but it also erases everything else, so copy and scan the files you need first.
Should I scan a brand-new USB stick?
It is a quick and sensible habit, especially for unbranded or promotional drives.
