本文介绍了我需要一个等待SQL Server启动的服务,然后启动我指定的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确保只要Windows启动,可执行文件就会启动.但是有一些并发症.

是否有人创建了"Windows服务",如果满足以下条件之一,它可以延迟启动"指定的可执行文件:

1.从计算机启动以来已经过去了x分钟,以便有时间放置其他内容(例如sql server)

2.或实际上循环检查sql server是否已启动,而不是等待x分钟

作为第二个目标,我将尝试向该服务添加WCF组件,该组件可以手动"从另一台计算机上的程序按需"启动exe.如果我能完成这些任务,并且没有人创建一篇文章可以分享此内容,那么我将为此撰写一篇文章.

I need to ensure that an executable starts whenever windows starts. But there are a couple of complications.

Has anyone created a "windows service" that can "delay start" a specified executable if one of these conditions are met:

1. x minutes has passed since the computer started, to give time for other stuff to be in place such as sql server

2. or actually loop to check if sql server has started instead of waiting for x minutes

As a second objective, I will try and add to this service a WCF component that could "manually" launch the exe "on demand" from a program on another computer. If I can accomplish these, and no one else has created an article to share this, I will contribute an article for this.

推荐答案


myInstaller.ServicesDependedOn = new string [] { "CLIPBOOK" }; 



我看到这里的依赖关系用引号引起来,所以我假设我必须确定在我的服务之前需要运行哪些sql server服务,并按上述方式添加它们而没有文件系统后缀;例如"MSSQLSERVER".

看起来正确吗?



I see the dependency here is in quotes, so I assume I would have to determine which sql server service(s) need to be running before my service, and add them as above without a file system suffix; e.g. "MSSQLSERVER".

Does that look right?


这篇关于我需要一个等待SQL Server启动的服务,然后启动我指定的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 12:32