设置服务器同步时间,并且每隔1小时同步一次。
@echo off
echo autor OAK
@echo off
echo --------------------------------
@echo off
echo setup time resync every one hour
@echo off
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 3600 /f
@echo off
echo --------------------------------
echo setup w32time auto startup
@echo off
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time /v Start /t REG_DWORD /d 2 /f
@echo off
echo --------------------------------
@echo off
set /p TimeServer=Please Input The Time Server IP:
net time /setsntp:%TimeServer%
net stop w32time
net start w32time
w32tm /resync
本文介绍了一种通过修改注册表来实现服务器时间自动同步的方法。每隔一小时,服务器会自动与指定的时间服务器进行时间同步,确保服务器时间的准确性。文章包含了具体的批处理脚本,包括设置特殊轮询间隔、自动启动W32Time服务以及输入时间服务器IP地址等步骤。
3415

被折叠的 条评论
为什么被折叠?



