Turn off Autoplay
Désactiver l’exécution automatique
Explanation
This policy setting allows you to turn off the Autoplay feature.
Autoplay begins reading from a drive as soon as you insert media in the drive. As a result, the setup file of programs and the music on audio media start immediately.
Prior to Windows XP SP2, Autoplay is disabled by default on removable drives, such as the floppy disk drive (but not the CD-ROM drive), and on network drives.
Starting with Windows XP SP2, Autoplay is enabled for removable drives as well, including Zip drives and some USB mass storage devices.
If you enable this policy setting, Autoplay is disabled on CD-ROM and removable media drives, or disabled on all drives.
This policy setting disables Autoplay on additional types of drives. You cannot use this setting to enable Autoplay on drives on which it is disabled by default.
If you disable or do not configure this policy setting, AutoPlay is enabled.
Note: This policy setting appears in both the Computer Configuration and User Configuration folders. If the policy settings conflict, the policy setting in Computer Configuration takes precedence over the policy setting in User Configuration.
Ce paramètre de stratégie vous permet de désactiver la fonctionnalité Exécution automatique.
La fonctionnalité Exécution automatique commence à lire le média d’un lecteur dès son insertion. Par conséquent, les fichiers d’installation des programmes et la musique des médias audio démarrent immédiatement.
Avant Windows XP SP2, la fonctionnalité Exécution automatique était désactivée par défaut sur les lecteurs amovibles, tels que les lecteurs de disquettes (mais pas sur le lecteur de CD-ROM), ainsi que sur les lecteurs réseau.
Depuis Windows XP SP2, la fonctionnalité Exécution automatique est activée également pour les lecteurs amovibles, y compris les lecteurs ZIP et certains périphériques de stockage de masse USB.
Si vous activez ce paramètre de stratégie, vous désactivez la fonctionnalité Exécution automatique sur les lecteurs de CD-ROM et les lecteurs de médias amovibles, ou sur tous les lecteurs.
Ce paramètre de stratégie permet de désactiver la fonctionnalité Exécution automatique sur les autres types de lecteurs. Vous ne pouvez pas utiliser ce paramètre pour activer la fonctionnalité Exécution automatique sur des lecteurs où elle est désactivée par défaut.
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, la fonctionnalité Exécution automatique est activée.
Remarque : ce paramètre de stratégie apparaît dans les dossiers Configuration ordinateur et Configuration utilisateur. Si les paramètres de stratégie sont en conflit, le paramètre de stratégie du dossier Configuration ordinateur a priorité sur le paramètre du dossier Configuration utilisateur.
Use cases
"Turn off Autoplay" stops Windows from automatically launching a medium's content as soon as it is inserted. Set it to "all drives" or "CD-ROM and removable media drives"; the corresponding value for the latter is 0xB5.
Autoplay settings in the UI stay visible and editable in Settings, but the policy takes precedence (behaviour documented by Microsoft).
Microsoft sources: Issues after Autoplay is disabled in Group Policy · Threats and Countermeasures Guide: External Storage Devices
Registry
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\ExplorerHKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Computer (HKLM)
Enable
# Enable: AutoPlay/Autorun
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Turn off Autoplay on
# Possible options:
# CD-ROM and removable media drives = 181
# All drives = 255
Set-ItemProperty -Path $k -Name 'NoDriveTypeAutoRun' -Value 181 -Type DWordDisable
# Disable: AutoPlay/Autorun
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": AutoPlay/Autorun
$k = 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer'
Remove-ItemProperty -Path $k -Name 'NoDriveTypeAutoRun' -ErrorAction SilentlyContinueUser (HKCU)
Enable
Disable
Revert to "Not configured"
Options (1)
| Label | Control | Registry value | REG type | Constraints / details | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Turn off Autoplay on:Désactiver la lecture automatique des :Autorun_Box | Drop-down listenum | NoDriveTypeAutoRun | REG_DWORD | Required · Default choice (UI): #0
|