开发者

How to start windows service

开发者 https://www.devze.com 2023-04-03 18:23 出处:网络
I have created a windows service with Automatic Start Type and install it in my system successfully but it does not start until i restart my system.

I have created a windows service with Automatic Start Type and install it in my system successfully but it does not start until i restart my system. Details: yesterday i have create and install my service and then restart my windows so the service started successfully. but the problem occurred today when i boot my windows and opened the services list of windows from Control Panel\Administrative Tools\Services and selected my service i saw that it did not start automatically.开发者_JAVA技巧 what is my mistake?


Assuming the service is set to 'Automatic' as the startup mode, and that it's state is not 'Started', then there will be at least one message about why the service did not start in the System Event Log.

Typical reasons are that the service didn't start quickly enough (Service Controller imposes a time limit on how quickly services must respond to the 'Start' message) or that the service depended on another service which wasn't yet available (check your service dependencies) or that your service simply failed due to a software error (e.g. some resource it needs could not be found).

Find the error in the event log, and you'll have a much better idea of why your service hasn't started.


As your service was running fine yesterday but not today. Checking all its dependencies would be my first suggestion.

In your Start-> Run, type services.msc . It's a shortcut to open the services console.

Then Right click on your service , if it is listed there, click on Properties on this popup menu.

Open the Dependency tab (4th tab) , check if your service depends on some other service and that dependency is running.

Regards,

bhupendra


Example:

SC.exe config "ServiceName" start= auto
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号