Windows任务计划程序无法重新启动 [英] windows task scheduler fails to restart

查看:203
本文介绍了Windows任务计划程序无法重新启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我构建了一个C#应用程序,它扫描文件夹并弹出一个表格,如果

文件夹中有任何文件。我已将此计划为

任务,使用Windows任务计划程序每1分钟重复一次。但是,b $ b发生的是,如果该应用程序正在运行,任务调度程序

无法启动相同的exe。否则它会启动它。有人对这个问题有任何建议吗?


谢谢,

CKG


(PS:启动时我的表单应用程序,扫描运行的同一个

程序的任何实例并将其杀死。当我尝试运行
$ b $时一切正常b手动多次执行!)

解决方案

尝试将其写为服务。


使用计时器勾选检查目录并跟踪您的

表格是否打开。

ch ************ @ gmail.com 写道:



我构建了一个C#应用程序,它扫描文件夹并弹出一个表单,如果该文件夹中存在任何文件。我已经安排这个作为
任务,使用Windows任务调度程序每1分钟重复一次。但是,如果该应用程序正在运行,那么任务调度程序
无法启动相同的exe。否则它会启动它。有没有人对这个问题有任何建议?

谢谢,
CKG

(PS:启动时我的表单应用程序,扫描任何实例运行同样的程序并将其杀死。当我尝试多次手动运行
exe时,一切正常!)



< blockquote>或者您可以使用文件系统监控类来检查文件夹中是否有

文件。


洛厄尔


Mike Newton写道:

尝试将其写为服务。

使用计时器勾选检查目录并跟踪您的
表单是否为是否公开。

ch *********** *@gmail.com 写道:



我构建了一个C#应用程序,扫描文件夹并弹出一个表格,如果
文件夹中存在任何文件。我已经安排这个作为
任务,使用Windows任务调度程序每1分钟重复一次。但是,如果该应用程序正在运行,那么任务调度程序
无法启动相同的exe。否则它会启动它。有没有人对这个问题有任何建议?

谢谢,
CKG

(PS:启动时我的表单应用程序,扫描任何实例同样运行并杀死它的程序。当我尝试多次手动运行
exe时,一切正常!)





< ch ************ @ gmail.com>在消息中写道

news:11 ********************* @ f14g2000cwb.googlegro ups.com ...



我构建了一个C#应用程序,扫描文件夹并弹出一个表格,如果文件夹中有文件存在。我已经安排这个作为
任务,使用Windows任务调度程序每1分钟重复一次。但是,如果该应用程序正在运行,那么任务调度程序
无法启动相同的exe。否则它会启动它。有没有人对这个问题有任何建议?

谢谢,
CKG

(PS:启动时我的表单应用程序,扫描任何实例运行相同的程序并将其杀死。当我尝试多次手动运行
exe时,一切正常!)



怎么可能应用程序运行超过一分钟是你必须回答的

问题。如果您安排任务每分钟运行一次,那么您需要确保只有一个实例在运行。


Willy。


Hi,

I built a C# application that scans a folder and pops up a form if
there are any files present in the folder. I have scheduled this as a
task to repeat every 1 min using the windows task scheduler. But what
happens is that if that application is running, the task scheduler
fails to start the same exe. Otherwise it starts it. Do any one have
any suggestions on this problem?

Thanks,
CKG

(P.S: My form app when started, scans for any instance of the same
program running and kills it. It all works fine when i try to run the
exe many times manually!)

解决方案

Try writing it as a service.

Use a timer tick to check the directory and keep track of whether your
form is open or not.

ch************@gmail.com wrote:

Hi,

I built a C# application that scans a folder and pops up a form if
there are any files present in the folder. I have scheduled this as a
task to repeat every 1 min using the windows task scheduler. But what
happens is that if that application is running, the task scheduler
fails to start the same exe. Otherwise it starts it. Do any one have
any suggestions on this problem?

Thanks,
CKG

(P.S: My form app when started, scans for any instance of the same
program running and kills it. It all works fine when i try to run the
exe many times manually!)



Or you could use the filesystem monitoring classes to check if there are
files in the folder.

Lowell

Mike Newton wrote:

Try writing it as a service.

Use a timer tick to check the directory and keep track of whether your
form is open or not.

ch************@gmail.com wrote:

Hi,

I built a C# application that scans a folder and pops up a form if
there are any files present in the folder. I have scheduled this as a
task to repeat every 1 min using the windows task scheduler. But what
happens is that if that application is running, the task scheduler
fails to start the same exe. Otherwise it starts it. Do any one have
any suggestions on this problem?

Thanks,
CKG

(P.S: My form app when started, scans for any instance of the same
program running and kills it. It all works fine when i try to run the
exe many times manually!)




<ch************@gmail.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...

Hi,

I built a C# application that scans a folder and pops up a form if
there are any files present in the folder. I have scheduled this as a
task to repeat every 1 min using the windows task scheduler. But what
happens is that if that application is running, the task scheduler
fails to start the same exe. Otherwise it starts it. Do any one have
any suggestions on this problem?

Thanks,
CKG

(P.S: My form app when started, scans for any instance of the same
program running and kills it. It all works fine when i try to run the
exe many times manually!)


How is it possible that the applications runs for more than a minute is the
question you have to answer. If you schedule a task to run every minute, you
have to make sure there is only one instance running.

Willy.


这篇关于Windows任务计划程序无法重新启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆