我正在使用Windows 7.我可以手动从ntp linux服务器同步win7的时间.我怎么能在命令提示符下执行此操作.所以我可以在Windows启动时运行它.Windows任务计划对我不起作用.时间应该是这样的:
Linux server --> windows 7.
Run Code Online (Sandbox Code Playgroud)
谁知道呢?谢谢.我可以阅读msdn.
Dom*_*nzi 49
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
Run Code Online (Sandbox Code Playgroud)
.BAT示例文件:https://gist.github.com/thedom85/dbeb58627adfb3d5c3af
我也推荐这个程序:http://www.timesynctool.com/
Loï*_*HEL 31
使用净时间
net time \\timesrv /set /yes
你的评论后在平均提示中尝试这个:
w32tm /config /update /manualpeerlist:yourtimerserver
Run Code Online (Sandbox Code Playgroud)
如果您只需要resyncWindows时间,请打开提升的命令提示符并键入:
w32tm /resync
Run Code Online (Sandbox Code Playgroud)
C:\WINDOWS\system32>w32tm /resync
Sending resync command to local computer
The command completed successfully.
Run Code Online (Sandbox Code Playgroud)
虽然w32tm /resync理论上可以完成这项工作,但它仅在某些条件下才会这样做。然而,当“精确到毫秒”很重要时,我发现 Windows 实际上不会进行调整;好像“哦,我走了 2.5 秒,离兄弟很近,这里没什么可看或可做的”。
为了真正强制重新同步(Windows 7):
w32tm /resyncwatch -n 0.1 date在 SSH 连接到的网络上的 Linux 机器上使用)--- 快速方法 ---
net start w32time (时间服务必须正在运行)time 8 (其中 8 可以替换为任何“小时”值,大概是 0-23)w32tm /resync