命令行配置服务启动类型

sc config <service name> start=<mode>
For example,

sc config tlntsvr start=auto
automatically starts the tlntsvr service when you boot the system.

The start options are

auto--a service automatically started at boot time, even if no user logs on
boot--a device driver loaded by the boot loader
demand--a service that must be manually started (the default)
disabled--a service that can't be started
system--a service started during kernel initialization

命令行开启windows ntp服务

sc config w32time start=auto
sc start w32time
reg add "HKEY_LOCAL_MACHINESystemCurrentControlSetServicesW32TimeTimeProvidersNtpServer" /v Enabled /t REG_DWORD /d "1" /f
原文地址:https://www.cnblogs.com/wolbo/p/15108878.html