如何增加windows服务启动超时

use*_*691 39 windows windows-service

我已将软件迁移到非常慢的服务器。由于系统超时,某些软件服务拒绝启动。如何将超时从默认的 30 秒(?)增加到几分钟?

先感谢您!

Hop*_*00b 75

您可以在注册表中修改超时值


1. Click Start, click Run, type regedit, and then click OK.
2. Locate and then click the following registry subkey:
 - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
3. In the right pane, locate the ServicesPipeTimeout entry.

**Note**: If the ServicesPipeTimeout entry does not exist, you must create it. To do this, follow these steps:

 - On the Edit menu, point to New, and then click DWORD Value.
 - Type ServicesPipeTimeout, and then press ENTER. 
4. Right-click ServicesPipeTimeout, and then click Modify.
5. Click Decimal, type 60000, and then click OK.
 - This value represents the time in milliseconds before a service times out.
6. Restart the computer.
Run Code Online (Sandbox Code Playgroud)


lau*_*jpn 7

下面是一个快速的单行代码,可以从提升的PowerShell 提示符执行,将挂起的服务超时设置为 3 分钟:

Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control" -Name ServicesPipeTimeout -Value 180000 -Type DWord