Friday, December 21, 2007

Shutting down a computer remotely

shutdown \\computername /l /a /r /t:xx "msg" /y /c

\\computername: Use this switch to specify the remote computer to shut down. If you omit this parameter, the local computer name is used.

/l (Note that this is a lowercase "L" character): Use this switch to shut down the local computer

/a: Use this switch to quit a shutdown operation. You can do this only during the time-out period. If you use this switch, all other parameters are ignored.

/r: Use this switch to restart the computer instead of fully shutting it down.

/t:xx: Use this switch to specify the time (in seconds) after which the computer is shut down. The default is 20 seconds.

"msg": Use this switch to specify a message during the shutdown process. The maximum number of characters that the message can contain is 127.

/y: Use this switch to force a "yes" answer to all queries from the computer.

/c: Use this switch quit all running programs. If you use this switch, Windows forces all programs that are running to quit. The option to save any data that may have changed is ignored. This can result in data loss in any programs for which data is not previously saved.

For example:

Shutdown /r /m \\server2

No comments: