Power options - Choose what the power buttons do - Change in REGISTRY


  1. Posts : 5
    windows 10
       #1

    Power options - Choose what the power buttons do - Change in REGISTRY


    Hi,

    I manage a fleet of 200 linx 8 tablets all running win 10 home.

    I need to issue a 'fix' that HIBERNATES the tablet rather than entering sleep when pressing the power button

    I will need to do this programatically - bundled within an .exe that I'm building - so the solution would ideally be an import of a new reg key....

    BUT what do I need to change and where?

    I think whatever I do, I may also need to enable hibernation, and disable connected standby. Also, as it may sometimes be mains and sometimes battery powered, cover both power scenarios.

    Apologies if I am repeating a previously asked question.

    many thanks
      My Computer


  2. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #2

    POWERCFG /HIBERNATE ON will enable Hibernate.
      My Computers


  3. Posts : 14,019
    Win10 Pro and Home, Win11 Pro and Home, Win7, Linux Mint
       #3

    This page is for WinXP but may or may not be of some consideration inasmuch as Tablets are notoriously short on storage space on the drive.
    Which folder or file does the hibernation process store the open files - Microsoft Community
      My Computers


  4. Posts : 5
    windows 10
    Thread Starter
       #4

    Hi,

    Thanks for the replies, but how do I get the tablet to enter hibernation when the power button is pressed? - It needs to be via a reg change rather than going into power setting etc..

    Thanks in advance....!
      My Computer


  5. Posts : 1
    windows 10
       #5

    gideon said:
    Hi,

    Thanks for the replies, but how do I get the tablet to enter hibernation when the power button is pressed? - It needs to be via a reg change rather than going into power setting etc..

    Thanks in advance....!
    you can do it with
    gpo: computer configuration > administrative templates > system > power management > button settings
    or
    powershell (balanced power plan)
    # Lid close action: 0 - Do nothing; 1 - Sleep; 2 - Hibernate; 3 - Shut down
    Start-Process -FilePath "C:\Windows\system32\powercfg.exe" -ArgumentList "-setACvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 1" -NoNewWindow -Wait
    Start-Process -FilePath "C:\Windows\system32\powercfg.exe" -ArgumentList "-setDCvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 1" -NoNewWindow -Wait
    # Power button action: 0 - Do nothing; 1 - Sleep; 2 - Hibernate; 3 - Shut down; 4 - Turn off the display
    Start-Process -FilePath "C:\Windows\system32\powercfg.exe" -ArgumentList "-setACvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 3" -NoNewWindow -Wait
    Start-Process -FilePath "C:\Windows\system32\powercfg.exe" -ArgumentList "-setDCvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 3" -NoNewWindow -Wait
    # Sleep button action: 0 - Do nothing; 1 - Sleep; 2 - Hibernate; 3 - Shut down
    Start-Process -FilePath "C:\Windows\system32\powercfg.exe" -ArgumentList "-setACvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 96996bc0-ad50-47ec-923b-6f41874dd9eb 1" -NoNewWindow -Wait
    Start-Process -FilePath "C:\Windows\system32\powercfg.exe" -ArgumentList "-setDCvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 96996bc0-ad50-47ec-923b-6f41874dd9eb 1" -NoNewWindow -Wait
      My Computer


  6. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #6

    See Shawn's tutorial, Option 3 via Command Prompt: Power Button Default Action - Change in Windows 10 - Windows 10 Forums.

    You would have to parse the output of powercfg /l from a Command Prompt or your program then issue the command shown for the GUID of the active Power Plan.
      My Computers


  7. Posts : 5
    windows 10
    Thread Starter
       #7

    Thanks for all your help - this is what I have ended up with

    configure your power plan as required (or create a new one)
    open cmd prompt
    powercfg /l - this lists the current power plans

    export power plan- see Power Plans - Export and Import - Windows 7 Help Forums

    then, in a batch file, import the powerplan and then set the action of the buttons and set the imported plan as active


    set myguid=ae0624db-9c90-466f-971c-bb5d30fc15f0 (this is the guid of the powerplan you exported)
    powercfg -import "C:\MyPath\MyPowerPlan.pow" %myguid%

    rem # Lid close action: 0 - Do nothing; 1 - Sleep; 2 - Hibernate; 3 - Shut down
    powercfg -setACvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 2
    powercfg -setDCvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 2

    rem # Power button action: 0 - Do nothing; 1 - Sleep; 2 - Hibernate; 3 - Shut down; 4 - Turn off the display
    powercfg -setACvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 2
    powercfg -setDCvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 7648efa3-dd9c-4e3e-b566-50f929386280 2

    rem # Sleep button action: 0 - Do nothing; 1 - Sleep; 2 - Hibernate; 3 - Shut down
    powercfg -setACvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 96996bc0-ad50-47ec-923b-6f41874dd9eb 2
    powercfg -setDCvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 96996bc0-ad50-47ec-923b-6f41874dd9eb 2

    powercfg -setactive %myguid%

    Thanks again for all your help - I couldn't have done this without it!
      My Computer


  8. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #8

    You're welcome.
      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 19:51.
Find Us




Windows 10 Forums