[Shell] 纯文本查看 复制代码 @echo off & title Windows搭建NTP时间同步服务器
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer /v Enabled /t REG_DWORD /d 1 /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config /v AnnounceFlags /t REG_DWORD /d 10 /f
sc config w32time start= auto
net stop w32time
net start w32time
cls&echo NTP时间同步服务器搭建完毕&pause>nul&exit |