Learn to use Windows XP Remote Shutdown

  
In Windows XP, a new command line tool "shutdown" has been added, which is used to "shut down or restart a local or remote computer." With it, we can not only log off the user, shut down or restart the computer, but also realize the timed shutdown and remote shutdown. The syntax of the command is as follows: shutdown [-i -l -s -r -a] [-f] [-m [\\\\ComputerName]] [-t xx] [-c "message"] [-d[u ][p]:xx:yy] where the meaning of each parameter is: -i A dialog box for displaying the graphical interface. -l Logs out the current user, which is the default setting. -m ComputerName takes precedence. -s Turn off your computer. -r Restart after rebooting. -a Suspends shutdown. Except for -l and ComputerName, other parameters are ignored. You can only use -a during the timeout period. -f Forces the application to be shut down. -m [\\\\ComputerName] Specifies the computer to shut down. -t xx Sets the timer used for system shutdown to xx seconds. The default is 20 seconds. -c "message" Specifies the message that will be displayed in the Messages area of ​​the System Shutdown window. You can use up to 127 characters. The message must be included in quotes. -d [u][p]:xx:yy Lists the reason codes for system shutdown. First, let's take a look at some basic usages of the command: 1. Log out the current user shutdown - l This command can only log off the local user and is not applicable to remote computers. 2, shut down the local computer shutdown - s 3, restart the local computer shutdown - r 4, timed shutdown shutdown - s -t 30 Specifies to automatically shut down the computer after 30 seconds. 5, stop the computer shutdown Sometimes we set the computer to shut down after a regular shutdown, if for some reason want to cancel the shutdown operation, you can use shutdown - a to abort. For example: shutdown -s C t 300 Set the computer to turn off after 5 minutes. Shutdown C a Cancel the above shutdown operation. The above are some basic applications of the shutdown command in this machine. As we mentioned earlier, in addition to shutting down and restarting the local computer, the command is more important to operate the remote computer, but how can it be achieved? In the format of the command, there is a parameter [-m [\\\\ComputerName], which can be used to specify the name of the computer to be shut down or restarted. If omitted, the default is to operate on the local machine. So, I tried it with the following command: shutdown Cs Cm \\\ etproxy -t 30 (turn off the machine named netproxy in 30 seconds; Note: netproxy is a computer with the same Windows XP in the LAN) But After the command was executed, the computer netproxy did not respond at all. On my screen, I returned a sentence like this: Access is denIEd. Why does this happen? I thought about it for a long time, looking around for relevant information, and finally found that in the default security policy of Windows XP, only the users of the administrator group have the right to shut down the computer from the remote end, and generally we come from other computers in the LAN. When accessing the computer, there is only the guest user right, so when we execute the above command, the "access denied" will occur. After finding the root cause of the problem, the solution is also very simple, as long as the client computer (capable of being remotely shut down, such as the above-mentioned netproxy) gives the guest the right to remotely shut down. This can be done using the "Local Security Policy" in Windows XP's "Group Policy" or "Administrative Tools". The following takes "Group Policy" as an example: 1. Click the "Start" button, select "Run", enter "gpedit.msc" in the dialog box, and then click "OK" to open the "Group Policy Editor" . 2. In the left pane of the Group Policy window, open Computer Configuration - Windows Settings - Security Settings - Local Policies - User Rights Assignment. (Figure) 3. In the right pane of the Group Policy window, select Force shutdown from a remote system and double-click. 4. In the pop-up dialog box, it is displayed that only members of the “Administrators” group have the right to shut down from the remote; click the “Add User or Group” button at the bottom of the dialog box, and then enter “guest” in the new pop-up dialog box. , then click "OK". 5. At this time, a "guest" user is added to the attribute "force shutdown from the remote system", and click "OK". 6. Close the Group Policy window. After the above operation, we granted the remote user permission to the guest user of the computer netproxy. Later, we need to remotely shut down the computer netproxy, just enter the following command in other computers with Windows XP on the network: shutdown -s Cm \\\ etproxy -t 30 (other parameters are the same as above) At this time, on the netproxy computer A “System Shutdown” dialog will appear on the screen, stating “The system is about to shut down. Please save all running work and log out. Unsaved changes will be lost. Shutdown is initiated by netproxy\\guest.” In the conversation There is also a timer below the box that shows how much time is left from the shutdown. While waiting for the shutdown, the user can also perform other tasks, such as closing the program, opening the file, etc., but cannot close the dialog unless you use the shutdown Ca command to abort the shutdown task. Finally, one thing to note is that the shutdown command can not only remotely shut down a computer with Windows XP, but it can also remotely shut down a computer with Windows 2000 (it doesn't seem to work for Win9X). For some settings on the Windows 2000 client computer, the operation method is the same as above, so I will not say more here. In addition, shutdown as an external command (the corresponding file is shutdown.exe under the \\Windows\\system32 folder), we can also copy it to the Windows 2000 machine, so that between the machines with Windows 2000 system It is also possible to remotely shut down each other.
Copyright © Windows knowledge All Rights Reserved