我正在使用Windows 7操作系统。我可以手动从一个NTP Linux服务器同步Win7的时间,但我想要在命令提示符中执行此操作,以便在Windows启动时运行它。对我来说,Windows任务计划不起作用。 时间应该是这样的:
Linux server --> windows 7.
有人知道吗?谢谢。我可以阅读MSDN。
net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"0.it.pool.ntp.org 1.it.pool.ntp.org 2.it.pool.ntp.org 3.it.pool.ntp.org"
net start w32time
w32tm /config /update
w32tm /resync /rediscover
.BAT示例文件:https://gist.github.com/thedom85/dbeb58627adfb3d5c3af
我还推荐这个程序:http://www.timesynctool.com/
使用 net time 命令:net time \\timesrv /set /yes
在管理员权限的命令提示符中尝试此命令:
w32tm /config /update /manualpeerlist:yourtimerserver
time /t
时,这让我很疯狂。@Kayasax - Nick Dongnet stop W32Time
然后重试 w32tm /resync
。 - Never Quit如果您只需要重新同步Windows时间,请打开一个已提升的命令提示符并键入:
resync
w32tm /resync
C:\WINDOWS\system32>w32tm /resync
Sending resync command to local computer
The command completed successfully.
w32tm /resync
来完成任务,但是它只在特定条件下才能实现。当 "毫秒级别" 很重要时,我发现 Windows 实际上不会进行调整; 就好像 "哦,我差了 2.5 秒,差不多啦,这里没什么好看或做的"。w32tm /resync
watch -n 0.1 date
)net start w32time
(时间服务必须正在运行)time 8
(其中 8 可以替换为任何小时值,可能是 0-23)w32tm /resync
timesynctool
的参考,正是我所需要的。 - kmonsoor