How to Disable AutoRun and AutoPlay for External Devices

AutoRun leaves your computer vulnerable to malware

The Windows AutoRun feature enables programs to run from external devices as soon as the device is attached to your computer. Because malware can exploit the AutoRun option by spreading a virus from your external device to your PC, many users choose to disable it.

AutoPlay is a Windows feature that's part of AutoRun. AutoPlay prompts you to play music and videos or display pictures. AutoRun, on the other hand, is a broader setting that controls the actions to take when a USB drive or CD/DVD is inserted into a drive on your computer.

Disable AutoRun in Windows

There's no interface setting to turn off AutoRun completely. Instead, you'll edit the Windows Registry.

  1. Press Win+R and type regedit to launch the Registry Editor. You must confirm elevated privileges to modify registry settings.

  2. Go to the key:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
    Windows registry editor
  3. If the entry NoDriveTypeAutoRun does not appear, create a new DWORD value by right-clicking in the right pane to access the context menu and selecting New DWORD (32-bit) Value.

  4. Name the DWORD NoDriveTypeAutoRun, and set its value to one of the following:

    • FF to disable AutoRun on all drives.
    • 20 to disable AutoRun on CD-ROM drives.
    • 4 to disable AutoRun on removable drives.
    • 8 to disable AutoRun on fixed drives.
    • 10 to disable AutoRun on network drives.
    • 40 to disable AutoRun on RAM disks.
    • 1 to disable AutoRun on unknown drives.
    Windows registry

To turn AutoRun back on, delete the DWORD NoDriveTypeAutoRun value.

Disable AutoPlay in Windows 

You can disable AutoPlay in a few steps, but the process depends on your Windows version.

Windows 10

  1. Select the Start icon in the lower-left corner, then select the Settings icon in the left pane.

    Windows 10 - selecting Start > Settings
  2. Select Devices.

    Windows 10, selecting Settings > Devices
  3. Select AutoPlay from the left pane, then select the AutoPlay toggle to turn it Off.

    Windows 10 - Turning AutoPlay off

Windows 8

In Windows 8 and 8.1:

  1. On the Start screen, select Apps > Windows System.

  2. Open the Control Panel and select AutoPlay.

  3. In the Choose what happens when you insert each type of media or device section, select the option you want. For example, you can choose different options for pictures or videos. To completely disable AutoPlay, deselect the Use AutoPlay for all media and devices box.

Was this page helpful?