Sysinternals PsTools


PsShutdown is a similar to the Resource Kit and Windows XP shutdown tools, providing you the same options and ability to shutdown, and optionally reboot, local and remote Windows NT/2K/XP/2003 systems. It also provided additional options that make it more powerful and flexible.


Copy PsShutdown onto your executable path and type "psshutdown" with command-line options defined below.


You can use PsShutdown to initiate a shutdown of the local or a remote computer, abort an imminent shutdown, logoff a console user, or lock the desktop.

usage: psshutdown [\\computer[,computer[,...] | @file [-u username [-p password]]]  -s|-r|-h|-d|-k|-a|-l|-o [-f] [-c] [-n s] [-t nn|h:m]  [-e [u|p]:xx:yy] [-m "message"]



Run the command on the computer or computers specified. If you omit the computer name the command runs on the local system and if you enter a computer name of \\* then the command runs on all computers in the current domain.



Execute the command on each of the computers listed in the file.



Specifies optional user name for login to remote computer



Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.



Aborts a shutdown (only possible while a countdown is in progress)



Allow the shutdown to be aborted by the interactive user



Shutdown reason code. Specify 'u' for user reason codes and 'p' for planned shutdown reason codes.
xx is the major reason code (must be less than 256)
yy is the minor reason code (must be less than 65536)



Forces all running applications to exit during the shutdown instead of giving them a chance to gracefully save their data



Hibernate the computer



Poweroff the computer (reboot if poweroff is not supported



Lock the computer



This option lets you specify a message to display to logged-on users when a shutdown countdown commences



Specifies timeout in seconds connecting to remote computers



Logoff the console user



Reboot after shutdown



Shutdown without poweroff



Specifies the countdown in seconds until the shutdown (default: 20 seconds) or the time of shutdown in 24 hour notation



Display message for the specified number of seconds before the shutdown. If you omit this parameter the shutdown notification dialog displays and specifying a value of 0 omits the dialog.