New
#1
Change Group Policy (gpedit.msc) setting with a shortcut
Is there a way to change a particular group policy setting (switch from enabled to disabled for example) with cmd, powershell or some other type of shortcut?
Is there a way to change a particular group policy setting (switch from enabled to disabled for example) with cmd, powershell or some other type of shortcut?
Hello ekeda,
Yes. You could use a .reg or .bat file to make changes to Registry Editor to change the group policy.
Which group policy is this for? I'll be happy to look up its registry settings.
Hi, Brink!
This one (both plugged in and on battery):
Here's the registry entries for both the "on battery" (DC) and "plugged in" (AC) policy.
(Disabled)
Code:Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\abfc2519-3608-4c2a-94ea-171b0ed546ab] "ACSettingIndex"=dword:00000000 "DCSettingIndex"=dword:00000000
(Enabled)
Code:Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\abfc2519-3608-4c2a-94ea-171b0ed546ab] "ACSettingIndex"=dword:00000001 "DCSettingIndex"=dword:00000001
(Not Configured)
Code:Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\abfc2519-3608-4c2a-94ea-171b0ed546ab] "ACSettingIndex"=- "DCSettingIndex"=-
Thank you, Brink, these are the keys indeed.
Sadly, using the registry does not produce an immediate effect (enable/disable sleep) like the gpedit. Any ideas how to solve this besides restarting explorer/re-logging?
You could create a .bat file to make the registry changes, and include restarting the explorer process at the end to apply.
Yes, but I am looking for a more gentle solution. I'll mark the thread as solved, but if someone (or I eventually found) has another way to approach this, please share it here.
Thank you, Brink, for the fast replies!
I am thinking about leaving sleep on AC enabled, while disabled on DC. The question then becomes how to switch these (plugged in vs battery) with a software?
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\abfc2519-3608-4c2a-94ea-171b0ed546ab]
"ACSettingIndex"=dword:00000001
"DCSettingIndex"=dword:00000000