Machine and user Windows 11Windows Server 2025Windows Server 2022Windows Server 2019Windows Server 2016
Supported on: At least Windows Server 2008 R2 or Windows 7
When the GPO stops applying: Windows removes the value (it is under a Policies branch). How cleanup works
| Registry key | HKLM\Software\Policies\Microsoft\Windows\Explorer |
|---|
| Registry key | HKCU\Software\Policies\Microsoft\Windows\Explorer |
|---|
| Value name | NoAutoplayfornonVolume |
|---|
| Enabled writes | 1 (REG_DWORD) |
|---|
| Disabled writes | 0 (REG_DWORD) |
|---|
What it does (vendor explanation)
This policy setting disallows AutoPlay for MTP devices like cameras or phones.
If you enable this policy setting, AutoPlay is not allowed for MTP devices like cameras or phones.
If you disable or do not configure this policy setting, AutoPlay is enabled for non-volume devices.
Group Policy path: Computer or User Configuration > Administrative Templates > Windows Components > AutoPlay Policies > Disallow Autoplay for non-volume devices
PowerShell equivalent (generated from the template)
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Windows\Explorer' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Windows\Explorer' -Name 'NoAutoplayfornonVolume' -Value 1 -PropertyType DWord -Force
Group Policy or Intune is the supported way to set policies. Writing the same values directly works like a local policy and is removed by nothing: delete the values to return to "Not configured".
File Explorer and desktopADMX: AutoPlay.admx · policy name NoAutoplayfornonVolume
Machine and user Windows 11Windows Server 2025Windows Server 2022Windows Server 2019Windows Server 2016
Supported on: At least Windows Vista
When the GPO stops applying: Windows removes the value (it is under a Policies branch). How cleanup works
| Registry key | HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
|---|
| Registry key | HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
|---|
| Value name | DontSetAutoplayCheckbox |
|---|
| Enabled writes | 1 (REG_DWORD) |
|---|
| Disabled writes | 0 (REG_DWORD) |
|---|
What it does (vendor explanation)
This policy setting allows you to prevent AutoPlay from remembering user's choice of what to do when a device is connected.
If you enable this policy setting, AutoPlay prompts the user to choose what to do when a device is connected.
If you disable or do not configure this policy setting, AutoPlay remembers user's choice of what to do when a device is connected.
Group Policy path: Computer or User Configuration > Administrative Templates > Windows Components > AutoPlay Policies > Prevent AutoPlay from remembering user choices.
PowerShell equivalent (generated from the template)
New-Item -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'DontSetAutoplayCheckbox' -Value 1 -PropertyType DWord -Force
Group Policy or Intune is the supported way to set policies. Writing the same values directly works like a local policy and is removed by nothing: delete the values to return to "Not configured".
File Explorer and desktopADMX: AutoPlay.admx · policy name DontSetAutoplayCheckbox
Machine and user Windows 11Windows Server 2025Windows Server 2022Windows Server 2019Windows Server 2016
Supported on: At least Windows Vista
When the GPO stops applying: Windows removes the value (it is under a Policies branch). How cleanup works
| Registry key | HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
|---|
| Registry key | HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
|---|
| Option | Value | Type | Allowed values |
|---|
| Default AutoRun Behavior | NoAutorun | | 1 (REG_DWORD) = Do not execute any autorun commands 2 (REG_DWORD) = Automatically execute autorun commands |
What it does (vendor explanation)
This policy setting sets the default behavior for Autorun commands.
Autorun commands are generally stored in autorun.inf files. They often launch the installation program or other routines.
Prior to Windows Vista, when media containing an autorun command is inserted, the system will automatically execute the program without user intervention.
This creates a major security concern as code may be executed without user's knowledge. The default behavior starting with Windows Vista is to prompt the user whether autorun command is to be run. The autorun command is represented as a handler in the Autoplay dialog.
If you enable this policy setting, an Administrator can change the default Windows Vista or later behavior for autorun to:
a) Completely disable autorun commands, or
b) Revert back to pre-Windows Vista behavior of automatically executing the autorun command.
If you disable or not configure this policy setting, Windows Vista or later will prompt the user whether autorun command is to be run.
Group Policy path: Computer or User Configuration > Administrative Templates > Windows Components > AutoPlay Policies > Set the default behavior for AutoRun
PowerShell equivalent (generated from the template)
# Default AutoRun Behavior
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoAutorun' -Value 1 -PropertyType DWord -Force
Group Policy or Intune is the supported way to set policies. Writing the same values directly works like a local policy and is removed by nothing: delete the values to return to "Not configured".
File Explorer and desktopADMX: AutoPlay.admx · policy name NoAutorun
Machine and user Windows 11Windows Server 2025Windows Server 2022Windows Server 2019Windows Server 2016
Supported on: At least Windows 2000
When the GPO stops applying: Windows removes the value (it is under a Policies branch). How cleanup works
| Registry key | HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
|---|
| Registry key | HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
|---|
| Option | Value | Type | Allowed values |
|---|
| Turn off Autoplay on: | NoDriveTypeAutoRun | | 181 (REG_DWORD) = CD-ROM and removable media drives 255 (REG_DWORD) = All drives |
What it does (vendor 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.
Group Policy path: Computer or User Configuration > Administrative Templates > Windows Components > AutoPlay Policies > Turn off Autoplay
PowerShell equivalent (generated from the template)
# Turn off Autoplay on:
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer' -Name 'NoDriveTypeAutoRun' -Value 181 -PropertyType DWord -Force
Group Policy or Intune is the supported way to set policies. Writing the same values directly works like a local policy and is removed by nothing: delete the values to return to "Not configured".
File Explorer and desktopADMX: AutoPlay.admx · policy name Autorun