選取開啟/關閉按鈕動作 (一般電源) 的登錄值 ACSettingIndex電腦HKLM\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280

原則 ID
ACPowerButtonAction_2
適用範圍
電腦設定
支援的作業系統
至少需要 Windows Vista
來源
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (版本 1.0)
類別
系統 › 電源管理 › 按鈕設定

登錄

ACSettingIndex

REG_DWORD電腦
啟用時的值
取決於選項值
元素
電源按鈕動作
選項
項目儲存的值
不執行動作0
睡眠1
休眠2
關機3
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280]

; 選項 (只使用其中一個)
; 不執行動作
"ACSettingIndex"=dword:00000000
; 睡眠
"ACSettingIndex"=dword:00000001
; 休眠
"ACSettingIndex"=dword:00000002
; 關機
"ACSettingIndex"=dword:00000003
CMD
:: 選項 (只使用其中一個)

:: 不執行動作
reg add "HKLM\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280" /v "ACSettingIndex" /t REG_DWORD /d 0 /f
:: 睡眠
reg add "HKLM\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280" /v "ACSettingIndex" /t REG_DWORD /d 1 /f
:: 休眠
reg add "HKLM\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280" /v "ACSettingIndex" /t REG_DWORD /d 2 /f
:: 關機
reg add "HKLM\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280" /v "ACSettingIndex" /t REG_DWORD /d 3 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280' -Force | Out-Null

# 選項 (只使用其中一個)
# 不執行動作
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280' -Name 'ACSettingIndex' -PropertyType DWord -Value 0 -Force | Out-Null
# 睡眠
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280' -Name 'ACSettingIndex' -PropertyType DWord -Value 1 -Force | Out-Null
# 休眠
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280' -Name 'ACSettingIndex' -PropertyType DWord -Value 2 -Force | Out-Null
# 關機
New-ItemProperty -Path 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\7648EFA3-DD9C-4E3E-B566-50F929386280' -Name 'ACSettingIndex' -PropertyType DWord -Value 3 -Force | Out-Null