Create a Windows 7 Autoplay Disabler — Disable Autorun for USBs and CDs
Disabling Autoplay/Autorun for USB drives and CDs in Windows 7 improves security (prevents malware from auto-running) and gives you control over how removable media behave. This guide shows three safe methods: Group Policy (recommended for Pro/Enterprise), Registry edit (works on any edition), and using Microsoft’s official tool. Follow the steps exactly and back up the registry before editing.
Before you start
- Backup: Create a System Restore point and export the registry (regedit > File > Export).
- Account: You need an administrator account.
- Scope: Group Policy applies to all users on the PC (or domain if applied centrally). Registry edits affect the local machine only.
Method 1 — Use Local Group Policy Editor (Windows 7 Professional / Ultimate / Enterprise)
- Press Windows key + R, type gpedit.msc and press Enter.
- Navigate to: Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies.
- Double-click Turn off Autoplay.
- Set to Enabled.
- In the “Turn off Autoplay on” dropdown select All drives.
- Click OK.
- (Optional) Double-click Set the default behavior for AutoRun and configure to Disabled or set policies to prevent AutoRun commands.
- Restart or run
gpupdate /force in an elevated command prompt to apply.
Effect: Autoplay prompts and automatic execution from removable media are disabled system-wide.
Method 2 — Registry Edit (All Windows 7 editions)
- Open Start, type regedit, right-click Registry Editor and choose Run as administrator.
- Navigate to:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
- If the Explorer key is missing, create it (right-click Policies > New > Key > name it Explorer).
- Create or modify the DWORD value NoDriveTypeAutoRun:
- Right-click in the right pane > New > DWORD (32-bit) Value > name it NoDriveTypeAutoRun.
- Set value (Decimal or Hex) to one of the common options below and click OK:
- 0xFF (255) — Disable Autoplay on all drive types (recommended).
- 0xFF – same as above for full disable; alternatively:
- 0xFF (Decimal 255) disables all.
- (Optional) Also create/modify NoViewOnDrive to hide drives, or other related policies per Microsoft docs.
- Close Registry Editor and restart your PC.
Quick explanation: NoDriveTypeAutoRun is a bitmask; setting it to 255 turns off Autoplay for every drive type.
Method 3 — Microsoft’s “DisableAutoplay” fix or Control Panel
Option A — Microsoft Fix It / Downloadable tool:
- Microsoft previously provided a downloadable fix/tool and knowledge base articles to disable Autoplay. If you prefer a tested tool, download the official Microsoft Fix It for disabling Autoplay and run it as administrator.
Option B — Control Panel (user-level prompts)
- Open Control Panel > Hardware and Sound > AutoPlay.
- Uncheck Use AutoPlay for all media and devices.
- Save changes.
Note: Control Panel settings may stop AutoPlay dialogs but won’t always prevent Autorun.inf execution; use Group Policy or Registry for full protection.
Verify Autoplay is disabled
- Insert a USB flash drive or CD — you should not see the usual AutoPlay dialog or automatic program execution.
- Check registry value NoDriveTypeAutoRun = 0xFF or gpresult /h report for applied Group Policy settings.
Revert changes
- Group Policy: Set Turn off Autoplay to Not Configured or Disabled and run
gpupdate /force.
- Registry: Delete the NoDriveTypeAutoRun value or set it to default (91 hex / 145 dec is Windows default behavior).
- Control Panel: Re-enable “Use AutoPlay for all media and devices.”
Troubleshooting
- If Autoplay still runs, ensure no third-party utilities override settings and that policies were applied (restart or gpupdate).
- For domain-managed computers, domain Group Policy may override local settings—contact your administrator.
Disabling Autoplay/Autorun is a straightforward security improvement for Windows 7. Use Group Policy for the most reliable system-wide control; registry edits work for Home editions.