Configure the timeout used when stopping / starting services

The Service Control Manager (SCM) is responsible for handling the startup and stopping of services. The SCM starts a service by launching the service-application, and then expects to receive a started-message from the service within a certain timeout.

Set this REG-DWORD key in the registry to specify the timeout in milliseconds:

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Control]
ServicesPipeTimeout = 30000

More Info MS KB824344
More Info MS KB884495

The SCM stops a service by sending a stop-message to the service and then expects to receive a stopped-message from the service within a certain timeout. Set this REG-SZ key in the registry to specify the timeout in milliseconds:

[HKEY_LOCAL_MACHINE \System \CurrentControlSet \Control]
WaitToKillServiceTimeout = "20000"

More Info MS KB146092
More Info MS KB839262

Note if lowering the value too much it might cause improper shutdown of some services, which might lead to half-written / invalid / faulty data that will keep the service from starting properly again.

Note if having an UPS make sure it can supply enough power to support the shutdown of the machine properly, if increasing the value.

Related Control Application Timeout

Updated: 13 June 2012

Comments:

  1. Guy says:

    I believe the ServicesPipeTimeout key should actually be a DWORD, not a REG_SZ. I don't know if it works both ways, but that is the way I've always seen it.

  2. Snakefoot says:

    @Guy Thank you for telling. I have updated the article.

  3. kalai says:

    I try this way but still services is not running

Leave a Reply

Your email address will not be published. Required fields are marked *