Win2003 command shutdown -r -t 0 (dos cmd restart)

  

Use the cmd command to shut down or restart your computer.

at 2:00 /every:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday shutdown /r /t 0 Automatically restart the server command at 2 am every morning.


Copying code
The code is as follows: shutdown /r /t 0

General


Copying code
The code is as follows: shutdown /f /R /t 0

You can write the above statement with Notepad, save as reboot.cmd, the extension is cmd, don't forget. r means that the new start t is the time unit is the second 0 is 0 seconds, immediately switch from the new start r to s is the shutdown, so you can set the automatic shutdown time to see how many seconds to set the line to set a certain time automatically Shut down or restart from the new one, you only need to run shutdown -a.

First talk about the shutdown command that comes with the system. Many people should already know that it is shutdown. Execution without parameters will be listed. Its parameters, commonly used parameters are:

/s Shut down the computer

/r Shut down and restart the computer

/f Force the running application to close without warning the user in advance

/t xxx Set the timeout before closing to xxx seconds.

The valid range is 0-600, the default is 30

In addition, you can cancel shutdown or restart by inputting shutdown /a during the countdown process, and countdown for 30 seconds without adding /t parameter.

Generally need to shut down immediately can be written like this: (Change the /s parameter to /r parameter is to restart immediately)

shutdown /f /s /t 0

shutdown support To operate on a remote computer, you need to use the /m parameter, such as:

shutdown /f /s /m \\\\\\\\test

Forcing the LAN to be named test after 30 seconds Computer Shutdown

After the at command, its purpose is to schedule commands and programs to run on the computer at the specified time and date. Entering at /? at the command line will list its help information, which is explained in more detail in the Help and Support Center.

Assuming you want to automatically shut down at 23:30 in the evening, you can write:

at 23:30 shutdown /f /s /t 0

If you succeed, there will be something like this Information response: A new job has been added, and its job ID = 1

To cancel this timed shutdown, there are two ways.

Method 1、Command Line

Executing at with no arguments will list the contents that have been set, and write down the status ID number. For example, this example is 1, then enter:

at 1 /delete

Abbreviated as:

at 1 /d

Without the serial number, using the /d parameter will delete all settings. If you want to delete all settings without confirmation, you can use: At /d /y

Method 2, Task Plan

The timing execution command set with the at command can be seen in the "Control Plan" > Task Schedule> To cancel, delete it. If you only use it temporarily, for example, if you need to automatically shut down on the same day, use the above instructions. If you need to perform it on a certain day of the month or every Monday or even every day, you need to add some additional parameters, still an example.

Example 1, automatic shutdown of 0, 1, 10, 10, 15, 20 of the month

at 00:00 /every:1,5,10,15,20 shutdown /f /s /t 0

Example 2: Automatic shutdown at 23:00 every Monday

at 23:00 /every:Monday shutdown /f /s /t 0

Example 3: Automatic shutdown at 22:00 every day

at 22:00 /every:Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday shutdown /f /s /t 0 Use the every parameter, The automatic shutdown every day in Example 3 can be abbreviated as: at 22:00 /every:Su,M,T,W,Th,F,Sa shutdown /f /s /t 0 Finally explain the command applies to XP/2003, Windows 2000 does not come with the shutdown command (of course, copy from the XP /2003 system can also be used in the past), I did not install Windows 2000 on my machine, I do not know whether it comes with the at command in 2000. In addition, the use of the at command instead of the task plan is because the task added with the at command is executed with the highest SYSTEM authority of the system. The login will also take effect, and the task added in the task plan needs to specify the administrator account. The password can be activated without logging in. The at command can also use \\\\\\\\computername to specify an auto-execute task plan on other computers in the LAN. Of course, the prerequisite is that you have the administrator account and password of the other machine.

Add two points:

1. When using the above command and executing the command, the system enters the shutdown countdown. At this time, if you are working, do not need to shut down, then immediately run in the countdown setting time  shutdown.exe -a” abort the shutdown command. You can also create a shortcut to this command on the desktop for easy access. 2, copy Shutdown.exe to 2000 system AT command can be fully used, including Win2000, Win2000Server. It is very convenient to use the at-shutdown command. For example, to shut down at 22:00 in the evening, you can use at 22:00 shutdown -s -f with ShutDown usage and parameter usage: shutdown [-i

Copyright © Windows knowledge All Rights Reserved