Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize automatic restart of IIS batch processing by server application

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to automatically restart IIS batches for server applications". The explanation in this article is simple and clear and easy to learn and understand. Please follow the editor's ideas to study and learn "how to automatically restart IIS batches for server applications".

Imagine: write a batch, restart IIS every hour, and run it 24 times.

Make a task schedule and run this batch once a day

Technical reserve:

Dos command restarted by IIS: iisreset / restart

Delayed command: create a .vbs file, enter the command: wscript.sleep (20000)

Call the .vbs file under dos: cscript s.vbs

Loop command: FOR / L% variable IN (start,step,end) DO command [command-parameters]

Achieve:

Create a .vbs file, such as s.vbs

* * *

Wscript.sleep (3600000)

* * *

Description: wscript.sleep (1000) indicates a delay of 1 second

Create a .bat file, such as a.bat

* *

For / l% an in (1meme 1mem24) do (

Iisreset / restart

Cscript / / nologo s.vbs

Time / t

)

* *

Description: for / l% an in (1meme 1mai 24) do means 24 times of circular execution.

Cscript / / nologo s.vbs means calling to execute the s.vbs file, and / / nologo means that the logo version information is not displayed, without this parameter

Also, it does not affect the execution of the program.

By feng1725

Attached:

In fact, the scheduled tasks that come with Windows can fulfill the requirement of running tasks every hour.

Create a new scheduled task, right-click when finished, and schedule task properties-- "schedule-- > Advanced"

Set start date check repeat task set every × × hour duration × × days

Create a .bat file, such as a.bat

* *

Iisreset / restart

* *

Note: if the scheduled task fails to start, you can check the log to find the reason.

Check the log of the Task Plan

Task schedule maintains a log file, SchedLgU.txt, in the% SystemRoot% folder (usually C:\ Windows). You can view the log from the task schedule window by clicking Advanced (menu bar), and then clicking View Log.

The size of the log file is 32KB, and when the log file reaches its maximum size, it automatically records new information from the beginning of the file and overwrites the old log file information.

Thank you for reading, the above is the content of "how to automatically restart IIS batches of server applications". After the study of this article, I believe you have a deeper understanding of how to automatically restart IIS batches of server applications, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report