Search code examples
windowswindows-servicesdelayed-execution

How to delay the start of a specific service in Windows Services?


I would like to delay the automatic start of a specific service, my tomcat client application here, that needs to wait few minutes before being launched so that another machine have enough time to start its own service before (database server here).

Is there any parameter for this in Windows server 2016?


Solution

  • Yes, this can be done for a specific service.

    You need to :

    1. First set your tomcat application Startup Type to "Automatic(Delayed Start)" in Services first.

    2.Go to your registry and add a registry key named “AutoStartDelay” with type “DWORD (32-bit)” in below location:

    HKLM\SYSTEM\CurrentControlSet\services<service name>\AutoStartDelay

    3.Modify the value data of AutoStartDelay with decimal. The value indicated is in seconds. For example, the following is for 2 minutes of delay : Configuration of the key in the registry

    4.Save the change in Registry.