1

I have a dummy application that I want to start as a Windows service. The application doesn't exist yet, but I know it needs to start automatically when the computer boots, so I'm trying to set up the installer now.

I have created the service with the following command:

sc create ServiceName binpath= C:\path\to\ServiceName.exe start= auto displayname= "Better Service Name"

This seems to work, I can see the service in Computer Management with the correct properties set.

However when I start the service, I see that the exe starts in the Task Manager, but then the Service Control window reports

"Error 1053: The service did not respond to the start or control request in a timely fashion."

And then the exe dies.

I have tried a registry edit to extend the timeout from 30sec to 180sec but that hasn't helped.

I also tried the steps suggested here, but I wasn't able to delete any of the files, "because the file is open in System". I'm not entirely sure what that means, but I haven't been able to solve it.

Is there anything else I can do to try to make this start?

I'm also open to other options for making this exe automatically start. I like the convenience of having a service in case it crashes for any reason, it might be easier to manage, but I'm not hard-line on that.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.