Set the default behavior for AutoRun
This policy controls how Windows handles AutoRun commands.
since 0.9.8.11
Purpose
Show registry keys (2)
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoAutorunHKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\NoAutorun
This policy controls how Windows handles AutoRun commands. These commands are usually stored in an autorun.inf file on the media and can launch an installer or another application.
NoAutorun is a REG_DWORD value. A value of 1 prevents AutoRun commands from executing. A value of 0 permits their automatic execution. When the policy is disabled or not configured, Windows Vista and later use the default behavior in which the AutoRun command is presented as a handler in the AutoPlay dialog and requires a user decision.
The entry under HKLM applies at the computer scope, while the entry under HKCU controls the behavior for the individual user.
Notes
Security
Automatic execution can start a program without prior user confirmation. If media contains a malicious or modified AutoRun command, code can consequently run with the permissions of the signed-in user. User Account Control and other Windows authorization checks still apply to operations that require elevated privileges.
Setting NoAutorun to 1 reduces this risk by preventing Windows from executing AutoRun commands specified in autorun.inf. It does not prevent users from manually opening files or launching programs stored on the media.
Possible side effects
When AutoRun commands are blocked, installers, menus, or other media applications designed to use AutoRun no longer start through that mechanism. The media remains accessible, and its contents can still be opened manually.
Notes
AutoRun and AutoPlay are separate Windows features. AutoRun processes commands from autorun.inf, whereas AutoPlay detects media content and offers suitable applications or actions. NoAutorun controls only the default treatment of AutoRun commands; it does not disable AutoPlay as a whole. Separate policies and registry values control that feature.
Additional restrictions imposed by the Windows version, drive type, or other AutoPlay policies can prevent execution independently of NoAutorun.
Microsoft documentation
Microsoft Learn: Autoplay Policy CSP – SetDefaultAutoRunBehavior
Microsoft Learn: Using Hardware AutoPlay