For some reason, the website fails for a period of time, and IIS restarts and returns to normal.
If this happens once or twice, the worst thing is that it happens every day. You cannot fight against IIS every day.
If you want to be lazy, you have to use your brains to find a batch.
Imagine: Write a batch, restart IIS once every hour, and run 24 times.
In a task plan, this batch is run once a day.
Technical Reserves:
IIS restart doscommand: iisreset/restart
Delayed command: Create a. vbs file and enter the command wscript. Sleep (20000) in the file)
Call the. vbs file in DOS: cscript S. vbs
Loop command: For/L % variable in (START, step, end) do command [command-parameters]
Implementation:
Create a. vbs file, such as S. vbs.
**************************************** *********
Wscript. Sleep (3600000)
**************************************** *********
Note: wscript. Sleep (1000) indicates a delay of 1 second.
Create a. BAT file, such as A. bat
***********************************
For/L % A in (1, 1, 24) Do (
Iisreset/restart
Cscript // nologo S. vbs
Time/T
)
***********************************
Note: For/L % A in (, 24) Do indicates that the loop is executed 24 times.
Cscript // nologo S. vbs indicates that the S. vbs file is called and executed. // nologo indicates that the logo version information is not displayed, without this parameter
Or not.ProgramRun
By feng1725
Appendix:
In fact, the Windows built-in scheduled task can meet the hourly task requirements.
Create a scheduled task, right-click the task, and choose schedule> advanced.
Set start date check repeated tasks set the duration of every × hours × days
Create a. BAT file, such as A. bat
***********************************
Iisreset/restart
***********************************
Note: If the scheduled task fails to be started, you can view the log to find the cause.
Check the logs of the "Task Scheduler"
The "Task Scheduler" maintains a log file schedlgu.txt in the % SystemRoot % folder (usually C: \ Windows. You can view logs in the task scheduler window by clicking advanced (menu bar) and then clicking View logs.
The size of a log file is 32 KB. When the maximum size of a log file is reached, it automatically records new information from the beginning of the file and overwrites the information of the old log file.