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.

Let's say I start a long-running process on my computer, and it is imperative that it not be interrupted (E.g. formatting a large drive).
I can't trust myself (or others using the machine) to remember to not hit the startmenu's Shut Down &/or to not press the physical button on the case.

How would I go about removing the ability for my computer to shutdown?

I've thought of one way;

  • in the startmenu's properties, change what the button does (to lock)
  • in Power Options, change what the physical button does (to Do Nothing)

But maybe a more generic way is needed; what if there's something unforeseen (like a program trying to shut the machine down, or a sleep timer).
I don't think hibernate or sleep will be an issue because this machine is in 'performance' mode, but let's assume it will be a problem to make any answers usable by others.

Do all the various methods for shutting down a Windows machine elicit the same shutdown.exe?
How hard is it to rename it/remove execute access to it?
I know Windows likes to replace items in it's Sys directories upon startup if they've been messed with, but that's ok. If the computer managed to turn off, it's too late anyway.

share|improve this question
    
Software-wise you can disable shutdown, but that won't prevent users from using the physical power button. As a workaround, you could replace the power button default action with hibernation. All running processes would be interrupted, though. They would continue after resuming from hibernation, but there could be unwanted side effects. –  and31415 Mar 12 at 10:59
1  
Unplug the power button from the mobo, that is the only way to be sure. I do this on all test systems I run to prevent just such an issue. If you want to get creative remove the regular power button and add an Aircraft toggle switch. This should give people enough pause that they won't flip the switch and the cover will also prevent accidental button presses but I admit this may be going a little too far, but it would be cool ;) –  Matty Mar 12 at 11:00

2 Answers 2

Typically, if you've turned off all power save settings, the PC shouldn't shut down on its own. There is no way for us to know every little nuance of that particular computer. You could try renaming shutdown.exe temporarily, but that doesn't prevent someone from doing a hard reset.

Turn off Windows Update during the process as it sometimes forces a restart.

To physically avoid yourself, or others, from accidentally shutting it off, putting a sign on the monitor, keyboard or front of the box warning not to turn it off would be cheap and simple.

enter image description here

share|improve this answer
    
I know renaming it should work, but it doesn't sound like you've tested it; it's a protected file. How would one go about it? Windows update isn't the only software to demand restarts. A program even suggesting a restart whilst your typing elsewhere can steal focus and accept a spacebar as an a-ok to ruin everything –  Hashbrown Mar 12 at 17:24
    
No, I've not tested it on Windows 7. My suggestion comes from experience in the past when I have renamed the file (in Windows XP). It is protected for a reason, it's not a good idea to modify system files. If you are looking for a fool proof way to know for sure it isn't going to shut down for ANY reason, we can not tell you that with any certainty. –  CharlieRB Mar 12 at 17:41

In the OS edit the registry and add/change the following values to prevent users from shutting down the system using the Start Menu. Make a backup copy of your registry before doing this, just in case.

User Key: [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]

System Key: [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\
Explorer]

Value Name: NoClose

Data Type: REG_DWORD (DWORD Value)

Value Data: (0 = shutdown enabled, 1 = shutdown disabled)

Even with the above values you can still shutdown the system from the commandline, so in that case just restrict that file. If you want to get a little complicated and messy create a wrapper/script for it. By default set shutdown.exe to not be executable, then in your wrapper set it to executable, execute it, then reset it to non-executable. Place this file in your home directory or use powershell and run it with elevated priv. There is no need to play move/rename games. Most users will not go into the commandline(if they even know it still exists) to shutdown a system, and in cases where they do you probably have a bigger issue.

Then you want to do the following to prevent Windows from shutting itself down:

Turn off Automatic Updates (it will auto reboot)

Set Power Options to Always On and set the system to not enter sleep or hibernate

I routinely do similar things on 2k3/2k8 machines that are in a datacenter to prevent accidental powering down of a physical machine and then having to drive out there to push a stupid button.

Then follow my comment above by removing the power button and replacing it with an Aircraft toggle switch. The power button is just a momentary switch, it you really cared then cut the switch off and then to turn the machine on/off touch the two wires together, but that is an ugly kludge. The cover on the toggle switch will prevent accidental use and will serve as the giant proverbial red button that you don't want to touch.

share|improve this answer
    
You can stop shutdown-from-startmenu from an option in its properties; no need for registry meddling. I wanted to move away from doing lots of little things for each case; I was asking if there was one way to stop it utterly –  Hashbrown Mar 12 at 17:26
    
make the shutdown non-executable –  Matty Mar 12 at 20:08

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.