Shut down when I press the sleep button

Discussion in 'Operating System' started by Stéphane Lenclud, February 3, 2016.

  1. Stéphane Lenclud
    • Team MediaPortal

    Stéphane Lenclud Development Group

    Joined:
    April 29, 2013
    Messages:
    2,562
    Likes Received:
    657
    Gender:
    Male
    Ratings:
    +1,270 / 8
    Home Country:
    Germany Germany
    Show System Specs
    I like my HTPC to shut down when I hit the power button on my remote control.
    The problem is that an MCE remote actually sends the sleep command when you hit the power button.
    By default on Windows (7, 8 and 10) the sleep button sends your computer into sleep mode.
    In your settings you can actually configure what is Windows doing in response to both power and sleep buttons.

    upload_2016-2-3_23-45-8.png

    Here are the options you have for your power button:

    upload_2016-2-3_23-46-0.png

    Now sadly the sleep button won't let you choose that shut down option:

    upload_2016-2-3_23-56-2.png

    However you can still tell Windows to shut down when the sleep button is pressed and that's how:
    • Run a command prompt as administrator.
    • Run powercfg -getactivescheme and note the scheme UID.
    • Run powercfg -q <scheme_guid> and note the UID for "Power buttons and lid" subsection.
    • Run powercfg -q <scheme_guid> <sub_guid> and note the UID for "Sleep button action" power setting.
    • Run powercfg -setacvalueindex <scheme_guid> <sub_guid> <setting_guid> <setting_index> where setting index is 3 for shut down.
    The command you will end up running to change that setting should look like:
    powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 96996bc0-ad50-47ec-923b-6f41874dd9eb 3
    Obviously the UIDs on your machine should be different so make sure you don't just copy and paste that command. You need to workout the UIDs for your setup as described above.

    Once you have executed that command properly, go back to your system settings where you should see the following:



    upload_2016-2-4_0-14-59.png

    Notice how the sleep button entry is empty. That's ok, it's just that the UI still won't show that shut down option.
    Now restart Windows for the changes to take effect, then you can try out your newly programmed sleep button.

    Special thanks goes to Wray Smallwood for publishing that solution.
    Microsoft community post
     
    Last edited: February 4, 2016
    • Informative Informative x 4
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!