← All articles

How to Disable AutoRun/AutoPlay in Windows 7, Vista, and XP (Historical)

Historical guide to reducing automatic media execution in Windows 7, Vista, and XP using AutoPlay policy rather than error-prone registry edits.

By ShantanuUpdated 13 Apr 20212 min read
How to Disable AutoRun/AutoPlay in Windows 7, Vista, and XP (Historical)

Historical support note: Windows 7, Vista, and XP are unsupported. This article is retained to document how AutoRun/AutoPlay controls worked on those systems.

AutoRun and AutoPlay are related but not identical. AutoRun lets media request automatic program execution, while AutoPlay is the user-facing action picker shown when media or devices are connected.

Because malicious removable media historically abused AutoRun behavior, administrators often disabled automatic actions.

Preferred method: Local Group Policy

Windows 7 and Windows Vista

  1. Press Windows key + R, type gpedit.msc, and press Enter.
  2. Go to Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies.
  3. Open Turn off AutoPlay.
  4. Set it to Enabled and choose the drive scope you want to disable.

Windows XP

The equivalent policy is under Computer Configuration > Administrative Templates > System > Turn off AutoPlay.

Home editions may not include Local Group Policy Editor.

About the old registry method

The original article treated this path as though NoDriveTypeAutoRun were a registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoDriveTypeAutoRun

NoDriveTypeAutoRun is actually a value under the Explorer key. Microsoft also warns that changing these AutoRun values globally is an administrative action and can have side effects. For that reason, Group Policy is the clearer method where available.

Official references