Monday, November 5, 2018

Windows 2003: auto time sync when CMOS battery is dead

modify registry to anticipate large time difference :
How to configure the Windows Time service against a large time offset
change MaxPosPhaseCorrection and MaxNegPhaseCorrection to 0xFFFFFFF

create schedule to run AT STARTUP that will launch batch file containing these commands :
w32tm /config /manualpeerlist:id.pool.ntp.org,0x8 /syncfromflags:MANUAL /reliable:yes
w32tm /config /update
net stop w32time
net start w32time

set retryCount=0

:SyncStart
if %retryCount == 90 goto SyncEnd
set /A retryCount=retryCount + 1

REM *** Resync the system clock
w32tm /resync
if errorlevel 1 goto SyncDelay
if errorlevel 0 goto SyncEnd

:SyncDelay
REM *** If unsuccessful, delay 10 seconds, then retry
choice /n /t:y,10>nul
goto SyncStart

:SyncEnd
---

summarized from :


No comments:

Post a Comment