Skip to content

ServiceStartConstants

SCM 何时及如何启动服务。在配置时赋给 ServiceManager.InstallStartMode;该值由 ServiceManager.Install 写入 SCM 数据库,之后可通过"服务"控制面板小程序或 sc.exe config 更改。

常量说明
tbServiceStartBoot0由引导加载程序在操作系统启动时启动。仅限内核驱动程序——不适用于 twinBASIC 服务。
tbServiceStartDriverSystem1Ntldr / Winload 在系统初始化期间启动。仅限内核驱动程序。
tbServiceStartAuto2由 SCM 在系统启动时自动启动,在任何用户登录之前。应始终运行的后台服务的典型设置。
tbServiceStartOnDemand3仅当有明确请求时 SCM 才启动(控制面板小程序、sc.exe startServices.LaunchService,或在 DependentServices 中列出它的服务)。新 ServiceManager 实例的默认值。
tbServiceStartDisabled4在管理员更改其启动模式之前无法启动。用于在不卸载服务的情况下停用服务。

对于用户模式 twinBASIC 服务,实际中只有三个值有用:tbServiceStartAutotbServiceStartOnDemandtbServiceStartDisabled

twinBASIC及其LOGO版权为作者"韦恩"所有