In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the use of the shutdown command, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Windows XP and 2003 systems are shut down through a program called Shutdown.exe, calling shutdown.exe when shutting down. It will be of great benefit to our work if we can make good use of this tool. First of all, take a look at its grammar.
Shutdown [/ I | / l | / s | / r | / a | / p | / h | / e] [/ f] [/ m / / ComputerName] [/ t XXX] [/ d [p:] XX:YY/c "Comment"]
Parameters.
/ I displays the remote shutdown dialog box. The / I option must be the first parameter typed, and all subsequent parameters will be ignored.
/ l logs out of the current user immediately, with no timeout period. You cannot use / l with / m / / ComputerName or / t.
/ s turn off the computer.
/ r restart the computer after shutting down.
/ a cancel shutdown operation (valid only during the timeout period). The a parameter can only be used with / m / / ComputerName.
/ p shuts down only the local computer (not the remote computer) with no timeout or warning. / p can only be used with / d. If your computer does not support the power off feature, using / p will shut down the system but will not power off your computer.
/ h puts the local computer in a dormant state, if hibernation is enabled. You can only use h with / f.
/ e allows you to record the cause of an unexpected shutdown on the target computer.
/ f forces the running application to be closed without warning the user in advance.
Warning: using the / f option may result in the loss of unsaved data.
/ m / / ComputerName specifies the target computer. Cannot be used with the / l option.
/ t XXX setting the timeout period or delay to XXX seconds before restarting or shutting down causes a warning message to be displayed on the local console. You can specify a range of 0-600 seconds. If / t is omitted, the default timeout period is 30 seconds.
/ d [p:] XX:YY lists the reasons why the system is rebooted, shut down, or powered off. The following table describes the parameter values.
P: indicates that the restart or shutdown is planned. If you do not use the p: option, the shutdown event tracker assumes that a restart or shutdown is not planned.
XX specifies the primary reason code (0-255).
YY specifies the secondary reason code (0-65535).
/ c "Comment" allows you to make a detailed comment on the reason for the shutdown. You must first use the / d option to provide a reason. Comments must be enclosed in quotation marks. You can use a maximum of 511 characters.
/? Displays help at the command prompt, including a list of primary and secondary reasons defined on the local computer. You can display help by simply typing shutdown without any parameters.
Note:
The user must be granted the right to shut down the system before the user can use the shutdown command to shut down local or remotely managed computers.
The user must be a member of the Administrators group to annotate the unexpected shutdown of computers managed locally or remotely. If the target computer is joined to a domain, members of the Domain Admins group may perform this process.
If you want to shut down more than one computer at a time, you can use a script to call shutdown for each computer, or you can use shutdown / I to display the remote shutdown dialog box.
Once you have specified the primary and secondary reason codes, you must first define those reason codes for each computer that plans to use a particular reason. If no reason code is defined on the target computer, closing the event tracker will not be able to record the correct reason text.
Remember to use the p: parameter to indicate that the shutdown is planned. Omit p: indicates that the shutdown is unplanned. If you type pgroup, followed by the reason code for the unplanned shutdown, the command will not perform the shutdown. Conversely, if you omit p: and type the reason code for the planned shutdown, the command will not perform the shutdown.
2. Examples of application:
(1) if you want to turn off the computer automatically after 1 hour. Use the following command to resolve:
Shutdown-s-t 3600 (the system shuts down the computer after 3600 seconds, the time can be set)
(2) automatic shutdown caused by RPC vulnerability. Use this command to cancel the countdown to automatic shutdown:
Shutdown-a (method: start-> run-> shutdown-a-> OK)
For example, the early viruses such as shock wave and shock wave are designed for the RPC (remote procedure call) vulnerability of WindowsXP, which causes the system countdown to shut down automatically, which must be a headache for many people. We can use this method to solve it. Or you can modify the system time to extend the shutdown.
(3) using Shutdown command to realize unified network shutdown.
Turn off all the machines through a computer. Because the Windows XP system is installed in the entire office environment, we can use the remote shutdown "Shutdown" command to achieve a unified shutdown. The specific methods are as follows:
Step 1 Click start → run, enter Gpedit.msc in the dialog box, and click to open the Group Policy Editor.
Step 2 Open "computer configuration → Windows Settings → Security Settings → Local Policy → user Rights assignment" on the left side of the Group Policy Editor window, and select "Force shutdown from remote system" in the right window. The pop-up dialog box shows that only members of the "Administrators" group currently have the right to remote shutdown; click the button at the bottom of the dialog box, and then enter "administrator" (administrator account) in the pop-up dialog box, and then click.
Step 3 then add a "administrator" user to the "forced shutdown from the remote system" attribute, click, and finally close the Group Policy Editor window.
After setting up the computers in the office environment, we granted the "administrator" users of each computer the right to shut down remotely. At that time, just do the following on your own machine:
Step 4 Click "start → run", enter "Shutdown-I" in the dialog box, and the "remote shutdown" dialog box will be displayed.
Then you can do it one by one, or you can build a batch script and execute it all at once.
(4) using ShutDown to restart the server regularly.
Click schedule Task in the start / Program / Accessories / system tool, pop up the scheduled Task window, then double-click add scheduled Task, run the scheduled Task Wizard, click the Open add New Task button, type the name of the task (such as "scheduled shutdown") in the dialog box that appears, and select "Daily" in the execution mode. Then press "next" to select the timed shutdown time (you can first try 1 minute later than the time displayed on the machine now), next select "when you click to complete to open the advanced properties of the task", click "finish", and finally right-click "timed shutdown" to open the properties, enter "C:\ Windows\ system32\ shutdown.exe-r-t 60" in the run bar, click "OK", and soon j will be OK.
3. Shutdown under linux
The shutdown command: you can safely shut down or restart Linux, which prompts all login users on the system with a warning before the system shuts down.
Format: shutdown [option] [time] [warning message]
The meaning of the options in the command:
K: it doesn't really turn off, but just sends a warning message to all users.
-r: restart immediately after shutdown.
-h: do not restart after shutdown.
-f: quickly shut down and skip fsck when restarting.
-n: fast shutdown, without init program.
-c: cancel a shutdown that is already running.
Thank you for reading this article carefully. I hope the article "what is the use of shutdown commands" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.