Set Windows time at boot – the ultimate reference

While preparing some 200 non-domain-registered Windows 7 systems as POS systems, we came across a couple of dead BIOS batteries. Time on these machines would start 1-1-2009 every time and while you could forcibly setup the correct time by pushing a couple of buttons inside of Windows, the question arose if it would be possible to correct time automatically. Well, turns out: it is.

The Internet is full of advice about how to proceed. Write a batch file, run w32time with a couple of well thought parameters, run w32time from the task scheduler – and so on. I even thought of this myself: when you know your systems start at 2009-01-01 00:00, it’s easy to schedule a couple of tasks for 2009-01-01 00:01, :02, :03 etcetera to correct the time with the w32time utility.

However, this felt wrong and luckily, there is a far better solution.

The first thing you should know is, that the w32time service does not start when a Windows 7 system isn’t part of a domain. That’s by design and it’s explained in kb2385818. Fixing this seems to require two commands: the first one disables the trigger to disable w32time for non-domain-registered systems; the second one enables a trigger to start w32time whenever the network becomes active:
sc triggerinfo w32time delete
sc triggerinfo w32time start/networkon stop/networkoff

The article seems to erroneously state that the first command will activate w32time to start automatically, but as far as my experience counts, it won’t.

Then there is a second issue, where w32time will not take large jumps when a W7 system isn’t domain controlled. This information comes from another Microsoft article, from Technet this time: cc773263 (I’m not sure, are Technet articles referred to by their number, as KB articles are? So is this Technet 773263?)

Here you can find the
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config\MaxPosPhaseCorrection registry setting. It’s 15 hours for non domain controlled machines – and “infinite” (0xffffffff) for domain controlled hosts.

So set this to 0xffffffff and you’re set.

Tags: , , , , , ,

Comments are closed.