— Christos D.
After some brainstorming, our team has come up with four potential solutions for you.
Solution #1: Set your Service to “Automatic (Delayed Start)”
The simplest way to delay a service is to adjust when it starts at boot. Instead of starting as soon as possible, you can tell Windows to launch the service about 2 (or more) minutes after boot.
To make that change:
Start the Services utility.
To do so, press the Windows + R keys to open the Run window, and then type services.msc.
Find your service in the list. Double-click its row to open the service’s properties.
In the Startup type field, select Automatic (Delayed Start) from the list:
Click OK to save your change.
Need to wait for longer than 2 minutes?
By default, all “delayed start” services are launched a couple of minutes after boot. Fortunately, that wait time is configurable and you can set it to longer if you like, but that setting applies to all delayed start services. There is simply no way to adjust the wait time of a single delayed start service.
Solution #2: Specify a Dependency between Services
Another option for delaying the start of a service is to mark it as dependent on another service.
To explain, let’s take two services, Service1 and Service2. If Service1 must start before Service2, you would update Service2 to add Service1 as a dependent. You would say that Service2 depends on Service1.
I know that may be a bit confusing, so let’s look at a real-world example.
Microsoft’s “System Events Broker” depends on a couple of services: “Remote Procedure Call (RPC)” and “RPC Endpoint Mapper”. You can see the relationship in the service’s properties (in the Services application):
Because of those dependencies, Windows will always start the two RPC services before launching the “System Events Broker” service.
So to delay the start of your important service, mark it as dependent on another, precursor service.
Note however, there are significant side effects of setting up a dependency relationship between two services.
For example, the screenshot above also shows that “Task Scheduler” depends on “System Events Broker”. As a result of that relationship, stopping “System Events Broker” will stop “Task Scheduler”, as the Services application informs us here:
You see, the dependency relationship is about much more startup sequence. It implies that “System Events Broker” is critical for “Task Scheduler” to operate.
So if you mark your service as dependent on another service, stopping that other service might stop your own. Make sure you’re OK with that.
Solution #3: Launch your service from an “at startup” scheduled task
Instead of having the Windows Services launch your service, you can shift that responsibility to the Windows Task Scheduler. And in doing so, you can introduce a post-boot delay to start the service after your machine settles down.
Here’s how to create a scheduled task that starts your service a few minutes after boot:
Launch the Task Scheduler.
To do so, press the Windows + R keys to open the Run window, and then type taskschd.msc.
On the right, click Create Basic Task to launch the wizard:
Give your task a meaningful name. For example, we’re restarting the Print Spooler service 10 minutes after boot:
For the trigger, choose When the computer starts:
For action, select Start a program:
In the Program/script field, enter NET.EXE.
And in the Add arguments field, enter START followed by the name of your service:
On the summary screen, check the Open the Properties dialog… box. We still need to make a few adjustments to the new scheduled task:
Click Finish to exit the wizard.
In the Properties window that comes up, affirm a couple of options:
Run whether user is logged on or not. Otherwise, your service will only restart when you’re logged on.
Run with highest privileges. Necessary because starting your service likely requires administrative rights.
Switch to the Triggers tab and edit the At startup trigger.
In the Edit Trigger window, check the Delay task for box and enter your delay in minutes. You may have to type the time as not all values appear in the dropdown:
Click OK to save your change.
Back on the Properties window, click OK to close out of the task. You will probably have to enter your password:
And now that you have a scheduled task to start the service when you want, you should prevent the service from trying to start automatically at boot. Open your service’s properties and change the Startup type to Manual:
Finally, please reboot and make sure that your service starts in the expected time frame.
Solution #4 (for AlwaysUp services only): Pause before starting
If your service was created by AlwaysUp, you are able to stall your application via a configuration setting.
To do so:
Edit your application in AlwaysUp.
Switch to the Startup tab.
In the Pause for field, enter a suitable delay in seconds:
Check the But only after a reboot box — to avoid the pause when you start the service/application manually.
Click OK to save your settings.
The next time your computer boots, Windows will start the AlwaysUp service. And, as you instructed, AlwaysUp will pause for a while before launching your application.
Hopefully one of these methods will work in your situation!