Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

The power button settings are, in both XP and 7, under "Power Options" (powercfg.cpl).

Power settings Power button settings

Also check the security policy (secpol.msc) – you may need to add Everyone and Anonymous under Local Policies - User Rights - Shut down the system, but this probably won't affect the power button (just the lock screen).


If the disk is not being actively used (written to), pulling the plug isn't that bad. From my experience, if any inconsistencies do appear, NTFS fixes them automatically.

share|improve this answer
1  
Ouch! 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 Aug 4 '11 at 16:26
    
Excellent, thank you so much! All, note this may not work until after a reboot as in my case. –  Paul Aug 9 '11 at 21:22
1  
Also, 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 Aug 9 '11 at 21:23
add comment

It is unclear from your question whether you can or cannot reach the power button.

All modern systems have a soft power button that does not cut the power.

However, holding the power button for 8 seconds will cause the BIOS to shut the computer down just like cutting the power.

If you cannot reach your power button, cutting the power to the system by removing the cord or flipping the switch on the power bar will work, but it's not the best thing for the hardware.

The other thing to do is put a script on both your machines calling psshutdown for the other machine, or for all the machines in the lab.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.