Change Group Policy (gpedit.msc) setting with a shortcut

Page 1 of 2 12 LastLast

  1. Posts : 20
    Windows 10
       #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?
      My Computer


  2. Posts : 68,959
    64-bit Windows 11 Pro for Workstations
       #2

    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.
      My Computers


  3. Posts : 20
    Windows 10
    Thread Starter
       #3

    Hi, Brink!

    This one (both plugged in and on battery):
      My Computer


  4. Posts : 68,959
    64-bit Windows 11 Pro for Workstations
       #4

    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"=-
      My Computers


  5. Posts : 20
    Windows 10
    Thread Starter
       #5

    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?
      My Computer


  6. Posts : 68,959
    64-bit Windows 11 Pro for Workstations
       #6

    You could create a .bat file to make the registry changes, and include restarting the explorer process at the end to apply.
      My Computers


  7. Posts : 20
    Windows 10
    Thread Starter
       #7

    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!
      My Computer


  8. Posts : 68,959
    64-bit Windows 11 Pro for Workstations
       #8

      My Computers


  9. Posts : 20
    Windows 10
    Thread Starter
       #9

    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?
      My Computer


  10. Posts : 68,959
    64-bit Windows 11 Pro for Workstations
       #10

    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
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 08:23.
Find Us




Windows 10 Forums