“自动”与“自动(延迟启动)”

本文探讨了在Windows系统中,服务启动类型'自动'与'自动(延迟启动)'的区别。前者在系统启动过程中即刻启动,后者则在所有自动服务启动完成后的默认2分钟后启动,这一设定有助于提升系统启动性能并增强安全性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

本文翻译自:“Automatic” vs “Automatic (Delayed start)”

When installing Windows services there are two options for automatically starting a Windows service on Windows startup. 安装Windows服务时,有两个选项可以在Windows启动时自动启动Windows服务。 One is Automatic , and the other is Automatic (Delayed start) . 一个是自动 ,另一个是自动(延迟启动) What is the difference between these two in detail? 这两者之间有什么区别?

For example, if you're creating the installer with wixtoolset, the ServiceConfig element has the DelayedAutoStart attribute. 例如,如果您使用wixtoolset创建安装程序,则ServiceConfig元素具有DelayedAutoStart属性。 How will that effect what happens when services are started at boot time? 如何在启动时启动服务时会发生什么?

WiX documentation: ServiceConfig Element WiX文档: ServiceConfig元素


#1楼

参考:https://stackoom.com/question/kDYL/自动-与-自动-延迟启动


#2楼

In short, services set to Automatic will start during the boot process, while services set to start as Delayed will start shortly after boot. 简而言之,设置为Automatic的服务将在引导过程中启动,而设置为Delayed的服务将在引导后立即启动。

Starting your service Delayed improves the boot performance of your server and has security benefits which are outlined in the article Adriano linked to in the comments. 启动服务延迟可以提高服务器的启动性能,并且具有安全性优势,这些优势在评论中链接到Adriano 的文章中列出。

Update: "shortly after boot" is actually 2 minutes after the last "automatic" service has started, by default. 更新: “启动后不久”实际上是在最后一次“自动”服务启动后2分钟,默认情况下。 This can be configured by a registry key, according to Windows Internals and other sources ( 3 , 4 ). 这可以通过一个注册表项根据被配置, Windows内部和其他来源( 34 )。

The registry keys of interest (At least in some versions of windows) are: 感兴趣的注册表项(至少在某些版本的Windows中)是:

  • HKLM\\SYSTEM\\CurrentControlSet\\services\\<service name>\\DelayedAutostart will have the value 1 if delayed, 0 if not. 如果没有延迟, HKLM\\SYSTEM\\CurrentControlSet\\services\\<service name>\\DelayedAutostart的值为1否则为0
  • HKLM\\SYSTEM\\CurrentControlSet\\services\\AutoStartDelay or HKLM\\SYSTEM\\CurrentControlSet\\Control\\AutoStartDelay (on Windows 10): decimal number of seconds to wait, may need to create this one. HKLM\\SYSTEM\\CurrentControlSet\\services\\AutoStartDelayHKLM\\SYSTEM\\CurrentControlSet\\Control\\AutoStartDelay (在Windows 10上):等待的十进制秒数,可能需要创建此一个。 Applies globally to all Delayed services. 全局适用于所有延迟服务。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值