Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to sync windows time from a ntp time server in command

Tags:

time

windows

ntp

I am working on windows 7. I can sync time of win7 from a ntp linux server manually. How can I do that in command prompt. So I can run it on windows startup. And windows task plan not work for me. The time should be like this:

Linux server -->  windows 7. 

Any one knows that? Thank you. I can read msdn.

like image 236
Nick Dong Avatar asked Apr 04 '14 12:04

Nick Dong


People also ask

What is the command to sync time?

Navigate to an elevated command prompt. At the command prompt, enter: w32TM /config /syncfromflags:manual /manualpeerlist:ntp.indiana.edu. Enter: w32tm /config /update. Enter: w32tm /resync. At the command prompt, enter exit to return to Windows.


2 Answers

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 Sample File: https://gist.github.com/thedom85/dbeb58627adfb3d5c3af

I also recommend this program: http://www.timesynctool.com/

like image 65
Domenico Zinzi Avatar answered Oct 01 '22 21:10

Domenico Zinzi


Use net time net time \\timesrv /set /yes

after your comment try this one in evelated prompt :

w32tm /config /update /manualpeerlist:yourtimerserver 
like image 26
Loïc MICHEL Avatar answered Oct 01 '22 21:10

Loïc MICHEL