Remote Shutdown

Introduction

Windows NT/2K does not come with a built-in command-line shutdown command. However, both the Windows NT 4 and Windows 2000 Resource Kits come with shutdown, a program that you can use to shutdown local and remote computers. PsShutdown is a clone of the Resource Kit shutdown tool, providing you the same options and ability to shutdown, and optionally reboot, local and remote Windows NT/2K systems.

Installation

  1. Download PsTools or PsShutdown from http://www.sysinternals.com/ntw2k/freeware/pstools.shtml or download from this site.
    Notice: The new PsShudown changed its parameters, and the example on this sites does not work as it is. In such case, use the copy on this site, or change the parameter accordingly.
  2. Just copy PsShutdown onto your executable path, and type psshutdown with command-line options defined below.

Usage

You can use PsShutdown to initiate a shutdown of the local or a remote computer, or to abort an imiment shutdown. If you use PsShutdown to perform a shutdown you must explicitly specify either the local system (with the -l switch) or a remote computer (by listing its name), but if you want to abort a shutdown PsShutdown assumes that you want to abort a shutdown of the local system unless you specify a remote computer name.

usage: psshutdown [-?] [-t nn] [-m "message"] [-f] [-r] [-a] [-l | \\computer]
-?Displays the supported options.
-tSpecifies the countdown in seconds until the shutdown (default: 20 seconds)
-mThis option lets you specify a message to display to logged-on users when a shutdown countdown commences
-fForces all running applications to exit during the shutdown instead of giving them a chance to gracefully save their data
-rReboot after shutdown
-aAborts a shutdown (only possible while a countdown is in progress)
-lShutdown the local system. You must specify this switch so that you don't inadvertently shutdown a computer by running PsShutdown without any parameters in the expectation that it will display its command-line options.
\\computerShutdown the computer specified

Example

If you want to shutdown several servers, you can make a batch file like below.
  • allshutdown.bat

  • psshutdown.exe \\server1 -t 10 -f
    psshutdown.exe \\server2 -t 10 -f
    psshutdown.exe \\server3 -t 10 -f
    psshutdown.exe \\server4 -t 10 -f
    
    If you logined by different user, you specify,
    psshutdown.exe \\server1 -t 10 -f -u Administrator -p password
    psshutdown.exe \\server2 -t 10 -f -u Administrator -p password
    psshutdown.exe \\server3 -t 10 -f -u Administrator -p password
    psshutdown.exe \\server4 -t 10 -f -u Administrator -p password
    

    Back - Support
    Google
    Web www.grape-info.com