Open in the explorer

Removable Disks: Deny execute access

Disques amovibles : refuser l’accès en exécution

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › Removable Storage Access FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Accès au stockage amovible
Supported on
At least Windows Server 2008 R2 or Windows 7 FR: Au minimum Windows Server 2008 R2 ou Windows 7
ADMX file
RemovableStorage.admx
Internal name
RemovableStorage/RemovableDisks_DenyExecute_Access_2

Explanation

This policy setting denies execute access to removable disks.

If you enable this policy setting, execute access is denied to this removable storage class.

If you disable or do not configure this policy setting, execute access is allowed to this removable storage class.

French text from Windows 11 26H2

Ce paramètre de stratégie refuse l’accès en exécution aux disques amovibles.

Si vous activez ce paramètre de stratégie, l’accès en exécution est refusé à cette classe de stockage amovible.

Si vous désactivez ce paramètre de stratégie ou ne le configurez pas, l’accès en exécution est autorisé pour cette classe de stockage amovible.

Use cases

Denies execution of programs from removable disks. This limits malware spreading through USB drives (a historical vector such as Conficker) without preventing users from reading documents on them.

Microsoft source: Threats and Countermeasures Guide: External Storage Devices

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\RemovableStorageDevices\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}
Value name
Deny_Execute
StateValue written
EnabledREG_DWORD = 1
DisabledREG_DWORD = 0

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.

Enable

# Enable: RemovableStorage/RemovableDisks_DenyExecute_Access_2
$k = 'HKLM:\Software\Policies\Microsoft\Windows\RemovableStorageDevices\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'Deny_Execute' -Value 1 -Type DWord

Disable

# Disable: RemovableStorage/RemovableDisks_DenyExecute_Access_2
$k = 'HKLM:\Software\Policies\Microsoft\Windows\RemovableStorageDevices\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'Deny_Execute' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": RemovableStorage/RemovableDisks_DenyExecute_Access_2
$k = 'HKLM:\Software\Policies\Microsoft\Windows\RemovableStorageDevices\{53f5630d-b6bf-11d0-94f2-00a0c91efb8b}'
Remove-ItemProperty -Path $k -Name 'Deny_Execute' -ErrorAction SilentlyContinue

Availability