-
-
Save johnnyfortner/0f4b27ec7139d4a0f8f25504ff12e1c7 to your computer and use it in GitHub Desktop.
forked from thedom85 to sync time every 60s on computer with damaged cmos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off & @setlocal enableextensions | |
:loop | |
@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 | |
timeout /t 60 >null | |
@endlocal & @goto :loop | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment