วันอังคารที่ 7 เมษายน พ.ศ. 2558

How to Shut Down and Reboot Remote PCs via the Command Prompt

Shutdown Command Parameters

PARAMETERFUNCTION
-sShuts down the comptuer.
-rReboots the computer.
-fForce-close all running applications.
-m \\ComputerSpecifies a specific computer on the network that you want to shut down or reboot. Absent this parameter, the command affects only the local PC on which it is run.
-t xxSets a delay (xx seconds) before the specified operation commences.
-c "message"Add your own text inside the quotations to provide remote users with a message about why and when their PC will shut down or reboot.
/aAborts a shutdown or restart if used during the (-t) delay period.
/hHibernates the computer.
/?Displays the full help document with all commands.
There are many more parameters and options for the shutdowncommand, most of which are only useful for those administering large networks. Small businesses and home users will primarily stick with the parameters above.

Shutdown Command Examples

To bring this all together, let’s go over a few examples. First, let’s say that you are connected to your office PC via Remote Desktop and you want to reboot it immediately. You know that no one else is using it and all of your documents and data are saved. While in the Remote Desktop session, launch Command Prompt on your office PC and type the following command:
shutdown -r -f -t 0
That command will reboot the computer (-r), force all applications to close so that one doesn’t get stuck and prevent the reboot from happening (-f), and it will happen immediately with a zero second delay (-t 0). In this case, we’re accessing the Command Prompt via Remote Desktop directly on the office PC, so we don’t need to specify the computer name with the -m parameter because we are, in effect, operating on the local machine, even though we’re not sitting in front of it.
command-prompt-shutdown
อ้างอิง : http://www.tekrevue.com/tip/shut-down-and-reboot-remote-pc/