Turn off automatic termination of applications that block or cancel shutdown
Désactiver l’arrêt automatique des applications qui bloquent ou annulent l’arrêt de l’ordinateur
Explanation
This policy setting specifies whether Windows will allow console applications and GUI applications without visible top-level windows to block or cancel shutdown. By default, such applications are automatically terminated if they attempt to cancel shutdown or block it indefinitely.
If you enable this setting, console applications or GUI applications without visible top-level windows that block or cancel shutdown will not be automatically terminated during shutdown.
If you disable or do not configure this setting, these applications will be automatically terminated during shutdown, helping to ensure that Windows can shut down faster and more smoothly.
Ce paramètre de stratégie spécifie si Windows permet ou non aux applications de console et aux applications d’interface utilisateur sans fenêtres de niveau supérieur visibles de bloquer ou d’annuler l’arrêt de l’ordinateur. Par défaut, ces applications sont automatiquement arrêtées si elles tentent d’annuler l’arrêt de l’ordinateur ou de le bloquer indéfiniment.
Si vous activez ce paramètre, les applications de console et les applications d’interface utilisateur sans fenêtres de niveau supérieur visibles qui bloquent ou annulent l’arrêt de l’ordinateur ne seront pas automatiquement arrêtées à l’arrêt de l’ordinateur.
Si vous désactivez ce paramètre ou ne le configurez pas, ces applications sont automatiquement arrêtées à l’arrêt de l’ordinateur, contribuant ainsi à garantir que Windows s’arrête plus rapidement et sans incident.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\System- Value name
AllowBlockingAppsAtShutdown
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_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: Winsrv/AllowBlockingAppsAtShutdown
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowBlockingAppsAtShutdown' -Value 1 -Type DWordDisable
# Disable: Winsrv/AllowBlockingAppsAtShutdown
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'AllowBlockingAppsAtShutdown' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Winsrv/AllowBlockingAppsAtShutdown
$k = 'HKLM:\Software\Policies\Microsoft\Windows\System'
Remove-ItemProperty -Path $k -Name 'AllowBlockingAppsAtShutdown' -ErrorAction SilentlyContinue