2
I want to use the power button to turn off my Windows 7 machine without having to login or unlock it. I want to do this on my machine, plus we will likely want to do it on some student lab machines. On my machine it's a pain because I have an faux "air gap" separating my main machine from this one because I do computer security work, and right now I don't even have a KVM yet so I have to swap mice and keyboards and press several buttons on the monitor and enter my password just so I can turn the thing off.
I of course Google'd this and searched SU extensively; the only close question I can find how to make KDE do this. Microsoft allows me to disable screensaver password protection entirely easily enough via the Power Options dialog or other ways, but I don't want to give some random person access to my account, I just want the machine to power off without having to pull the plug and possibly corrupt the drive. Basically I want "psshutdown" to run when I press the power button. I also checked the Windows policy editor but couldn't find anything easily.
I think Windows XP did this, although I can't recall for sure. I realize that some of my applications might be very unhappy about being told to go away whether they like it or not, but I don't really care. I suppose if Windows refused to complete shutdown if the applications refused to quit that would be ok.
2Ouch! pulling the plug, nasty way to shut down, you better hope there is not an open handle when you do this. Yes I have done it many times without issues, but making it a common practice is ill advised. – Moab – 2011-08-04T16:26:04.173
Excellent, thank you so much! All, note this may not work until after a reboot as in my case. – Paul – 2011-08-09T21:22:47.470
1Also, I would not advise pulling the power plug in most situations. Worries include quality of NTFS journal recovery, whether the sparking is hard on the power supply, and whether desktop hard drives really always autopark properly on unwarned powerfail. – Paul – 2011-08-09T21:23:12.773