Change Start Menu power button: registry value PowerButtonActionUserHKCU\Software\Policies\Microsoft\Windows\Explorer

Policy ID
PowerButtonAction
Scope
User Configuration
Supported on
Windows Server 2008 R2 and Windows 7
Source
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (version 1.0)
Category
Start Menu and Taskbar

Registry

PowerButtonAction

REG_DWORDUser
Enabled value
Depends on the option value
Element
Choose one of the following actions
Options
ItemStored value
Shut Down2
Sleep16
Log off1
Lock512
Restart4
Switch User256
Hibernate64
Apply with .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Explorer]

; Options (use only one)
; Shut Down
"PowerButtonAction"=dword:00000002
; Sleep
"PowerButtonAction"=dword:00000010
; Log off
"PowerButtonAction"=dword:00000001
; Lock
"PowerButtonAction"=dword:00000200
; Restart
"PowerButtonAction"=dword:00000004
; Switch User
"PowerButtonAction"=dword:00000100
; Hibernate
"PowerButtonAction"=dword:00000040
CMD
:: Options (use only one)

:: Shut Down
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 2 /f
:: Sleep
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 16 /f
:: Log off
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 1 /f
:: Lock
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 512 /f
:: Restart
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 4 /f
:: Switch User
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 256 /f
:: Hibernate
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v "PowerButtonAction" /t REG_DWORD /d 64 /f
PowerShell
# Common: create the key
New-Item -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Force | Out-Null

# Options (use only one)
# Shut Down
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 2 -Force | Out-Null
# Sleep
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 16 -Force | Out-Null
# Log off
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 1 -Force | Out-Null
# Lock
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 512 -Force | Out-Null
# Restart
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 4 -Force | Out-Null
# Switch User
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 256 -Force | Out-Null
# Hibernate
New-ItemProperty -Path 'HKCU:\Software\Policies\Microsoft\Windows\Explorer' -Name 'PowerButtonAction' -PropertyType DWord -Value 64 -Force | Out-Null