- April 29, 2013
- 2,576
- 1,294
- Home Country
- Germany
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.
Here are the options you have for your power button:
Now sadly the sleep button won't let you choose that shut down option:
However you can still tell Windows to shut down when the sleep button is pressed and that's how:
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:
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
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.
Here are the options you have for your power button:
Now sadly the sleep button won't let you choose that shut down option:
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.
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:
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: