Open in the explorer

Allow applications to prevent automatic sleep (on battery)

Autoriser les applications à empêcher le passage en veille automatique (sur batterie)

Type
Computer
GPO path
Computer Configuration › Policies › Administrative Templates › System › Power Management › Sleep Settings FR: Configuration ordinateur › Stratégies › Modèles d'administration › Système › Gestion de l’alimentation › Paramètres de la veille
Supported on
At least Windows Server 2008 R2 or Windows 7 FR: Au minimum Windows Server 2008 R2 ou Windows 7
ADMX file
Power.admx
Internal name
Power/AllowSystemPowerRequestDC

Explanation

This policy setting allows applications and services to prevent automatic sleep.

If you enable this policy setting, any application, service, or device driver prevents Windows from automatically transitioning to sleep after a period of user inactivity.

If you disable or do not configure this policy setting, applications, services, or drivers do not prevent Windows from automatically transitioning to sleep. Only user input is used to determine if Windows should automatically sleep.

French text from Windows 11 26H2

Ce paramètre de stratégie permet aux applications et aux services d’empêcher la mise en veille automatique.

Si vous activez ce paramètre de stratégie, les applications, les services ou les pilotes de périphérique empêchent Windows de passer automatiquement en veille à la suite d’un délai d’inactivité.

Si vous désactivez ou ne configurez pas ce paramètre, les applications, services ou pilotes n’empêchent pas Windows de passer automatique en veille. Seule l’entrée utilisateur est utilisée pour déterminer si Windows doit passer automatiquement en veille.

Registry

HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2
Value name
DCSettingIndex
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: Power/AllowSystemPowerRequestDC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DCSettingIndex' -Value 1 -Type DWord

Disable

# Disable: Power/AllowSystemPowerRequestDC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DCSettingIndex' -Value 0 -Type DWord

Revert to "Not configured"

# Revert to "Not configured": Power/AllowSystemPowerRequestDC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2'
Remove-ItemProperty -Path $k -Name 'DCSettingIndex' -ErrorAction SilentlyContinue

Availability