I want to run a schedule task before a specified windows service (Service A). Service A starts automatically.

What is the best approach to take? Do I need to convert the schedule task into a service (Service B) and configure Service A to depend on Service B?



Services can't depend on scheduled tasks, so you can't do it that way.

Making a service depend on another may not do what you need, either; That just makes sure that service B is running when service A is started. If you need your custom task to finish its operations first, that won't help you.

What you can do is set the service to Manual start, and have your task start the service after doing what ever else it must do.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.