Using shutdown command to realize remote shutdown and restart in LAN

Source: Internet
Author: User

Usage: shutdown [/I |/L |/s |/r |/g |/a |/p |/h |/e |/o] [/hybrid] [/soft] [/f]
[/M \\computer] [/t XXX] [/d [P|U:]XX:YY [/C] comment "]

No parameter display Help. This with type/? is the same.
/? Displays Help. This is the same as not typing any options.
/I displays the graphical user interface (GUI).
This must be the first option.
/L logoff. This cannot be used with the/m or/d option.
/s shuts down the computer.
/R completely shuts down and restarts the computer.
/g completely shut down and restart the computer. After rebooting the system,
Restart any registered applications.
/A aborts the system shutdown.
This can only be used during the timeout period.
/p shuts down the local computer without a timeout or warning.
Can be used with the/d and/F options.
/h hibernate the local computer.
Can be used with the/F option.
/hybrid perform a computer shutdown and prepare to start quickly.
Must be used with the/s option.
/E records the cause of the computer shutdown unexpectedly.
/O go to the Advanced Boot Options menu and restart your computer.
Must be used with the/r option.
/m \\computer specifies the target computer.
/t xxx will be closed before the timeout is set to xxx seconds.
The valid range is 0-315360000 (10) and the default value is 30.
If the time-out is greater than 0, it is implied as
/F parameter.
/C "comment" a comment about the cause of the restart or shutdown.
A maximum of 512 characters is allowed.
/F forces the running application to close without warning the user beforehand.
If you specify a value greater than 0 for the/t parameter,
The/f parameter is implied.
/d [P|u:]xx:yy provides reasons for restarting or shutting down.
P indicates that the restart or shutdown is planned.
U indicates that the reason is user-defined.
Restart or close if p is not specified and U is not specified
Is out of the plan.
XX is the main reason number (a positive integer less than 256).
YY is a secondary reason number (a positive integer less than 65536).

At first I was because in a forum to see a remote shutdown software, I think he is the use of this command bar, toss a bit, or record how to use:

Example:

1) Auto power off after 30 seconds

>shutdown-s

This will pop up the Auto Power off dialog box, the default 30 seconds after the shutdown

2) Auto Power off after 1 hours

>shutdown-s-T 3600

3) automatic shutdown at 10 o'clock

>at 22:00 Shutdown-s

This will display a message similar to "Add a new job, its job ID = 1" and adds a shutdown task.

4) Remote PC restart

>shutdown-m \\[IP address or computer name]-R

If the remote PC is not powered on or the network is not connected, you will be prompted to "the network path cannot be found." ”;

If the remote PC is already locked, you will be prompted to "the computer is locked and does not use the force option to shut down." , add the-f option;

If the command runs successfully, the remote PC displays the Auto Shutdown dialog box, which has a default of 30 seconds to wait;

If you regret, you can run ">shutdown-m \\[ip address or computer name"-A "cancel;

If you do not have remote shutdown permissions, you are prompted to "Deny access." ", you need to refer to the following instructions to open remote shutdown permissions.

Access to remote shutdown permissions:

1) Modify the remote PC's "Local Security Policy" to open permissions for the specified user

In the default security policy for Windows XP, only users of the Administrators group have permission to shut down the computer from the remote End if you want to give the XXXX user the right to remotely shut down the machine. You can do this by using the local Security policy in Group Policy or Administrative tools in Windows XP.

1. Run gpedit.msc on the command line to open the Group Policy Editor;

2. Navigate to "Computer Configuration/windows Settings/security Settings/Local Policies/user Rights Assignment";

3. Modify " force shutdown from remote system ", add xxxx user.

2) Gain remote IPC management privileges

If you configure the first step, you also see "Access denied." ", you need to run the following command before running the shutdown command

net use \\[IP address or computer name]\ipc$ password/user:xxxx

Where password is the account XXXX login password.

After testing, sometimes there will be permission to shut down other people's computer, and occasionally deny access, I am in the school room inside the operation, need special note is must be the same LAN, if you do not know what IP is and you in the same LAN, then you can view through Arp-a:

Note: Only show as dynamic is you the same LAN other users, and then you can see the front IP, you can let the designated IP of the computer shutdown, because some computers deny access, so here use cannot use wildcard characters. And then arp-a This command sometimes is not good to use, recommend a software can see other users on the same LAN Ip--wnetwatcher

Please check your own IP first to avoid accidentally turning off your own computer to view the method:

Input ipconfig on it, I am wireless, so this is the above, if you do not know how to use the words can be viewed here

And then you can manipulate it, like I'm shutting down 10.253.7.23. Then you can do this.

Shutdown–s–t 10–m \\10.253.7.23–c "Alien invasion, computer off immediately"-F

If you want to restart the then change-s to-R can, –c "alien invasion, computer immediately shut down" This is a pop-up dialog box for that person to see,-f is mandatory command because of the C, so I need to let him have enough time to see me to his prompt, so I-t 10 set shutdown countdown to 10 seconds, If you turn it off now, it can be-t 0. -M \\10.253.7.23 is the IP that specifies the computer to be shut down.

Be careful to use this command, the teacher found it very dangerous ha.

Using shutdown command to realize remote shutdown and restart in LAN

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.