Remove Power Button Options in Windows 7

  • In the Start menu search box type gpedit.msc and press Enter.
  • In the Local group policy editor, go to User Configuration –> Administrative Templates –> Start Menu and Taskbar in the left.
  • On right click on Remove and prevent access to the Shut down, Restart, Sleep and Hibernate commands. Click Edit.
  • Now choose the Enabled option and click the OK button.
  • Now you are Done !

Shut Down, Restart, Log Off XP Using A Batch File

 

First of all we have to check the commands available for doing this sort of work, First To show you what you will see at a command prompt (command.com) when you type: “shutdown /?” Without the ” “.

c:\>shutdown /?
Usage: SHUTDOWN [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "c
omment"] [-d up:xx:yy]

No args                 Display this message (same as -?)
-i                      Display GUI interface, must be the first option
-l                      Log off (cannot be used with -m option)
-s                      Shutdown the computer
-r                      Shutdown and restart the computer
-a                      Abort a system shutdown
-m \\computername       Remote computer to shutdown/restart/abort
-t xx                   Set timeout for shutdown to xx seconds
-c "comment"            Shutdown comment (maximum of 127 characters)
-f                      Forces running applications to close without warning
-d [u][p]:xx:yy         The reason code for the shutdown
u is the user code
p is a planned shutdown code
xx is the major reason code (positive integer less than 256)
yy is the minor reason code (positive integer less than 65536)

To create a batch file for this you can use notepad, and save the file as .bat in c:\ (root directory)

if you want to shutdown the PC, Type the following command and save it as a .bat file.

shutdown -s t 30 -c " Shutting down"

Restart

shutdown -r

Force Shutdown

shutdown -f

Logoff

Shutdown/Restart/Logoff a Remote PC, Type your computer name or IP address instead “computername”.

shutdown -s -m \\computername