Ranktinis Windows laiko sinchronizavimas
Jump to navigation
Jump to search
Batch scriptas kurį užvardiname kaip timesync.bat.
@echo off REM *** Retry for up to 1 minutes (12 retries @ 5 seconds each) set retryCount=0 :SyncStart if %retryCount == 12 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 5 seconds, then retry choice /n /t:y,5>nul goto SyncStart :SyncEnd echo Time Sync successful
Išsaugome į c:\windows, taip pat galime panaudoti automatinį paleidimą sistemos startavimo metu:
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run] “TimeSync”=”C:\\WINDOWS\\timesync.bat”
Universalios laiko zonos nustatymas:
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1