I dual-boot between Xubuntu and Windows 10. In Xubuntu, when I press the power button, a dialog pops up with buttons for shut down, restart, etc. I frequently use this to restart the computer, but I also use it when I want to shut it down, and I'd like to have the same thing in Windows, because (1) I keep pressing the power button out of habit instead of using the menus, and (2) like pushing the power button and then pushing an option on my touchscreen a lot better than pushing Windows+X->U->U, mostly because U (Shutdown) and I (Sign Out) are right next to each other, which leads to some mistakes when I'm trying to hastily shut down at the end of class.
I know how to change what the power buttons do from the Control Panel, but is there any way I can set the power button to prompt me for what I want to do every time I push it?
Or, better yet, is there any way to override the control panel's settings and make the power button launch an arbitrary executable or script that I could design myself (to match Xubuntu's menu)?
Best Answer
There is no direct way to do this anymore. Windows XP used to have a feature in the Power control panel where you could set the power button to ask you what you want to do. However, that functionality was dropped in Windows Vista and later.
There is a way to simulate the behavior with local security policy, however.
gpedit.msc
)Display Shutdown Event Tracker
and double-click it. Enable the policy and set the display mode toAlways
(screenshots below)With this policy enabled, Windows will prompt you for the reason you are shutting down the computer. Not exactly a friendly "Do you want to shut down" box, but it does provide a backstop for when you hit the power button.