WinService按计划启动但在20秒内停止

WinService按计划启动但在20秒内停止

本文介绍了WinService按计划启动但在20秒内停止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个WinService并在Scheduled Tasks上设置它的启动和停止。但是,每天服务启动大约20秒后,即使在计划任务中,如果启动失败,我也会重新启动,它会自动停止而不会发出任何警报。因此,我必须每天早上手动重新启动服务。现在,我想编写一个可以执行以下任务的批处理文件:

1)检查WinService的运行位置

2)如果不在1),启动服务

3)写下1)和2)的记录。

我确实从网站上读了几个帖子,但是我找不到一个提供好的帖子跟进程序。如果你可以分享你的经验,我将不胜感激。

I created a WinService and set up its start and stop on Scheduled Tasks. But everyday after the service is started for about 20 seconds, it automatically stops without any alert even though in Scheduled Task I did setup re-starting if starting fails. Therefore, I have to re-start the service manually everyday morning. Now, I want to write a batch file that can implement the following tasks:
1) Check where the WinService is running
2) If not in 1), start the service
3) Write the record for 1) and 2).
I did read a couple posted threads from websites, but I have not found one one that provides a good procedure to follow up. If you can share your experience on it, it will be greatly appreciated.

推荐答案


这篇关于WinService按计划启动但在20秒内停止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-11 09:43