How to Set automatic timed Restart for WINDOWS Server

Source: Internet
Author: User

 

The biggest headache for Windows is that it will be restarted at the most time. The server version is still like this. After a while, it may feel something wrong! But manual restart is very troublesome! Is there any good method? The answer is "OK", "yes", and "yes! Next, I will introduce a service that can be automatically restarted at regular intervals without any third-party software, which is conducive to WINDOWS's own commands and functions!

 

Windows server 2003has a command for shutdown.exe. I don't know if you have noticed it. The specific parameters are as follows:

 

Usage: shutdown [-I |-l |-s |-r |-a] [-f] [-m \ computername] [-t xx] [-c "comment"] [-d p: xx: yy]

No parameter to display this message (? Same)

-I: displays the GUI, which must be the first option.

-L logout (cannot be used with option-m)

-S: disable this computer

-R: Disable and restart this computer

-A discard system shutdown

-M \ computername: Remote Computer shutdown/restart/discard

-T xx: Set the timeout value to xx seconds.

-C "comment" Close comments (127 characters at most)

-F: the application that is forced to run is disabled without warning.

-D [p]: xx: The cause code of yy's shutdown

U is the user code

P is the code to close a plan.

Xx is a major cause code (a positive integer smaller than 256)

Yy is a secondary cause code (a positive integer smaller than 65536)

U is the user code

P is the code to close a plan.

Xx is a major cause code (a positive integer smaller than 256)

Yy is a secondary cause code (a positive integer smaller than 65536)

This command, such as shutdown/r, can be used to restart windows. With this command, it is easier to automatically run it every day, you can use the scheduled task function of WINDOWS.

 

Careful friends may find that there is no shutdown command in Windows2000. What should I do! Oh! COPY the previous one from windows 2003!

 

For ease of use, I wrote a batch to set these operations, which can be automatically set to restart at every day. After the system is installed, it can only run once. If you do not want it later, you can delete the corresponding items in the scheduler tasks in the control panel.

 

@ Echo off

Echo ┌ ── ─

Echo │ timed restart of Windows Server │

Echo │ ------------------------------------------------ │

Echo │ version: V1.0 │

Echo │ platform: w2k/w2k3 tested │

Echo │ Author: A Zhi │

Echo │ home: http://www.azhi.net.cn www.2cto.com │

Echo │ MSN: azhi_lee@hotmail.com │

Echo └ ── ─

Echo is setting ......

Copy shutdown.exe % windir % \ system32 \ shutdown.exe

At 4: 00/every: M, T, W, Th, F, S, Su shutdown.exe/r

Echo settings are complete. Press any key to exit ......

Pause & gt; null

Related Article

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.