Contents // Make Windows synchronize time more often | |
Make Windows synchronize time more oftenThis page explains how to make the Windows network time (NTP) client synchronize its time more often than the default once per week.This was tested on Windows 7 but should work with Windows XP and above. Why is this important?I don't know about your machines but both my desktop and my HTPC have terrible clocks. They seem to drift by about five minutes each week and that messes up things like scheduled TV recordings or stating that it is 13:37 o'clock on IRC when it's not. Despite the apparent awfulness of PC clocks, Windows doesn't provide any user-facing options to change the clock-sync frequency below once a week.How not to do it 1: The Synchronize Time taskI've seen suggestions that you change the existing Synchronize Time scheduled task so that it runs more often. That does not help. I tried making that task run once a day and my clocks still drifted. Upon investigation, that task simply makes sure the Windows Time service is running and if it's already running the task does nothing. In that situation it's still up to the Windows Time service when to actually performs a sync, which will be once per week.How not to do it 2: The SpecialPollInterval registry valueThere is a SpecialPollInterval setting under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpClient (note: it has moved at least once between Windows versions) which is the time (in minutes) between time syncs... Sort-of...While modifying that registry value may update the "next sync time" displayed in the control panel, I have found it does not actually affect how often the clock is synched. Feel free to play with it if you want but that's my verdict. As far as I can tell, the registry value changes how often the time service wants to sync but only applies when time service is actually running. When the time service runs is controlled by the Windows Task Scheduler, not the registry value, and (at least on Windows 7) when the service runs it exits immediately after performing any required work. After that the time service will not do anything -- or run at all -- until the Task Scheduler starts it again. I suspect if you modify the SpecialPollInterval value and change the Synchronize Time task frequency then it might work, but that is difficult to verify. On the other hand, my method (below) is a similar amount of effort and is trivial to verify: You can mess up your system time and then manually run the task to verify that it gets corrected right away. How to do it: A different scheduled taskThe W32tm.exe tool, with /resync argument, triggers a clock sync, provided the Windows Time service is running. (If you want to test it manually, note that the command requires administrator rights and that the service may need to be started.)It's easy to set up a scheduled task which ensures the Windows Time service is available and then runs W32tm.exe /resync once a day, or as often as you like:
(After doing that, it seems normal for the task's status to remaing "Running" even though it only runs for a brief moment. Task Scheduler doesn't seem to update the status very well and you have to hit F5.) If the task doesn't seem to work, double-check everything is set up as shown above. You should also check the Date and Time control panel to ensure it is set to synchronize time via the Internet. You might also want to use a closer NTP server (e.g. one run by your ISP). (Note that the Date and Time control panel will still say the next synchronization is a week away. It only knows about its own schedule and doesn't know about the task we just set up.) |
0 件のコメント:
コメントを投稿