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_MACHINE\System\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer" /v Enabled /t REG_DWORD /d "1" /f