主板电池没电了,写个开机自动同步网络时间的脚本,设置为开机自动执行,设置NTP服务器为ntp5.aliyun.com
net stop w32time
w32tm /unregister
w32tm /register
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w32time\Config" /v MaxNegPhaseCorrection /t reg_dword /d 0xFFFFFFFF /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\w32time\Config" /v MaxPosPhaseCorrection /t reg_dword /d 0xFFFFFFFF /f
net start w32time
w32tm /resync
w32tm /resync
#pause
自动同步网络时间:开机脚本设置与NTP服务器配置
本文介绍了如何在主板电池没电导致时间错乱的情况下,编写一个开机自动同步网络时间的Windows批处理脚本。通过停止w32time服务、注销与注册服务、修改注册表项并启动服务,最后使用ntp5.aliyun.com作为NTP服务器进行时间同步,确保系统时间准确无误。
1万+

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



