Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a script in command prompt that will permanently remove a user's right to shutdown a machine. I've done it before, but in Windows XP, and many years ago, and I think I did it in Group Policy Editor.

How do I create a batch script to disable the shutdown button on Windows 7?

share|improve this question
Just to clarify: Do you want to disable a user from being able to shutdown the system no matter what? Or just make the Shutdown button in the Start Menu do something else? Or remove it from the Start menu? – Canadian Luke Sep 24 '13 at 1:17

Windows shut down, restart, sleep and hibernate are controlled by one .exe file: %windir%\system32\shutdown.exe

So as you want to do this from a command line and not a GPO we need to use the only tools we have at our disposal Command Prompt:

icacls %windir%\system32\shutdown.exe /deny SID:D

This will remove their access to the shutdown command and they will not be able to execute a shutdown.

share|improve this answer

Disable Shutdown, Restart, Sleep, and Hibernate Buttons

To open Local Group Policy Editor, click on Start and type in gpedit.msc and hit Enter.

In Local Group Policy Editor navigate to User Configuration \ Administrative Templates \ Start Menu and Taskbar and double click on Remove and prevent access to the Shut Down, Restart, Sleep, and Hibernate commands.

Now you want to enable this setting and click Apply and Ok. You can leave a note to yourself in the comment box, which I find comes in handy when changing a lot of settings in Group Policy.

Now when you look at the Power options in the Start Menu, the only options available are Log off, Switch user, and Lock.

The setting goes into effect right away for all users of the machine. The button to turn off the computer if the user hits Ctrl+Alt+Del will be gone as well.


share|improve this answer

Your Answer


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.