标签:main pause 处理 manual tps oca inter art flag
rem 设置本批处理文件命令文件所在的文件夹 set path=%SystemRoot%;%SystemRoot%\system32 rem 修改注册表项 reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "NtpServer" /t REG_SZ /d "10.101.70.10" /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DataTime\Servers" /v "0" /t REG_SZ /d "10.101.70.10" /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config" /v "AnnounceFlags" /t REG_DWORD /d "10" /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /v "SpecialPollTimeRemaining" /t REG_MULTI_SZ /d "10.101.70.10,0" /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /v "Enabled" /t REG_DWORD /d "0x00000001" /f rem 修改为12小时同步一次 reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d "43200" /f rem 修改为客户端模式后重新同步 w32tm /config /manualpeerlist:10.101.70.10,0x8 /syncfromflags:MANUAL net stop w32time net start w32time w32tm /resync rem 将Windows Time服务设置成随系统自动启动 sc config w32time start= auto rem 设置完成 pause
主要是有些场景开启了组策略,漏掉了这项:
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\Parameters
win2003系统同步Linux ntp server批处理
标签:main pause 处理 manual tps oca inter art flag
原文地址:https://www.cnblogs.com/bugbeta/p/10122818.html