Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@echo on & @setlocal enableextensions
@echo =========================
@echo Turn off the time service
net stop w32time
@echo ======================================================================
@echo Set the SNTP (Simple Network Time Protocol) source for the time server
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"
@echo =============================================
@echo ... and then turn on the time service back on
net start w32time
@echo =============================================
@echo Tell the time sync service to use the changes
w32tm /config /update
@echo =======================================================
@echo Reset the local computer's time against the time server
w32tm /resync /rediscover
@endlocal & @goto :EOF
@Dimon1358

This comment has been minimized.

Copy link

@Dimon1358 Dimon1358 commented Apr 16, 2017

Thanks!

@Baanin

This comment has been minimized.

Copy link

@Baanin Baanin commented Apr 25, 2017

Thanks

@yangloc

This comment has been minimized.

Copy link

@yangloc yangloc commented May 22, 2017

Thanks a lot!

@mathandy

This comment has been minimized.

Copy link

@mathandy mathandy commented Jun 3, 2017

To others: make sure you "run as admin".
@thedom85 Thanks!

@rlogan403

This comment has been minimized.

Copy link

@rlogan403 rlogan403 commented Oct 9, 2017

Thanks.

@z00sts

This comment has been minimized.

Copy link

@z00sts z00sts commented Mar 12, 2018

👍

@benjamin238

This comment has been minimized.

Copy link

@benjamin238 benjamin238 commented Jun 28, 2018

👍

@ediband

This comment has been minimized.

Copy link

@ediband ediband commented Feb 21, 2019

Great script, thx!

@truekenny

This comment has been minimized.

Copy link

@truekenny truekenny commented Jun 17, 2019

Work on Win10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.