Swiped from: http://www.pretentiousname.com/timesync/index.html


Make Windows synchronize time more often

This 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 task

I'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 value

There 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 task

The 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:

    Open Task Scheduler (on Vista and above, just type that into the Start Menu and you'll find it).

    Find the Microsoft / Windows / Time Synchronization branch and click Create Task...

    (You can create the task anywhere but you might as well keep things tidy.)
    Give the new task a name. I called mine Actually Synchronize Time.

    Set the new task to run as the LOCAL SERVICE user.

    Set it to run with highest privileges and to be configured for your OS version.
    Set the task to run daily at the time you want. I suggest 1:15am as it's 15 minutes after the default Synchronize Time task.
    The task will have two actions. Make sure they end up in the right order. The first action does the same as the original Synchronize Time task and ensures the Windows Time service is running. The second action makes the actual time sync happen.

    Set the first action to start a program, which is \system32\sc.exe with arguments start w32time task_started
    Set the second action to start a program, which is \system32\w32tm.exe with argument /resync
    Turn off the setting which makes the task only run on AC power. The task is very brief so there's no reason not to run it when on battery power.

    Set the task to start only if a network connection is available.
    Set the task to run as soon as possible if its schedule is missed.

To test that the task actually works, manually mess up your clock's time and then right-click the task and select Run. Your clock's time should be corrected.

(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.)


Page last modified by NeilHerber, July 07, 2012, at 06:44 PM