How to Turn Off AutoPlay for USB Drives in Windows 11 to Prevent Malware

AutoPlay is a legacy Windows feature designed for convenience. Whenever you plug in a USB flash drive or insert a DVD, AutoPlay automatically launches a prompt asking what you want to do with the files. Unfortunately, this convenience comes at a massive security cost. Hackers frequently use “autorun” scripts on infected USB drives to silently execute malware the exact second the drive is plugged into your PC. To protect your computer from infected external media, you should turn AutoPlay off completely.

How to Disable AutoPlay

Disabling this feature prevents Windows from automatically scanning or executing any files when a new device is connected.

  1. Open the Settings app by pressing Windows Key + I on your keyboard.
  2. In the left-hand sidebar, click on Bluetooth & devices.
  3. Scroll down the main window and click on AutoPlay.
  4. At the very top of the menu, look for the master toggle switch labelled: Use AutoPlay for all media and devices.
  5. Click the toggle switch to turn it Off.

From now on, when you plug a USB drive into your computer, absolutely nothing will happen on your screen. You will have to manually open File Explorer and double-click the USB drive icon to view its contents, ensuring that no malicious scripts can ever run without your explicit, manual permission.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.