{"id":632,"date":"2016-06-30T10:29:46","date_gmt":"2016-06-30T08:29:46","guid":{"rendered":"http:\/\/valentijn.sessink.nl\/?p=632"},"modified":"2016-06-30T10:31:27","modified_gmt":"2016-06-30T08:31:27","slug":"set-windows-time-at-boot-the-ultimate-reference","status":"publish","type":"post","link":"https:\/\/valentijn.sessink.nl\/?p=632","title":{"rendered":"Set Windows time at boot &#8211; the ultimate reference"},"content":{"rendered":"<p>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.<!--more--><\/p>\n<p>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 &#8211; and so on. I even thought of this myself: when you know your systems start at 2009-01-01 00:00, it&#8217;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.<\/p>\n<p>However, this felt wrong and luckily, there is a far better solution.<\/p>\n<p>The first thing you should know is, that the <strong>w32time service does not start when a Windows 7 system isn&#8217;t part of a domain<\/strong>. That&#8217;s by design and it&#8217;s explained in <a href=\"https:\/\/support.microsoft.com\/en-us\/kb\/2385818\" target=\"_blank\">kb2385818<\/a>. 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:<code><br \/>\nsc triggerinfo w32time delete<br \/>\nsc triggerinfo w32time start\/networkon stop\/networkoff<\/code><br \/>\nThe article seems to erroneously state that the first command will activate w32time to start automatically, but as far as my experience counts, it won&#8217;t.<\/p>\n<p>Then there is a second issue, where <strong>w32time will not take large jumps when a W7 system isn&#8217;t domain controlled<\/strong>. This information comes from another Microsoft article, from Technet this time: <a href=\"https:\/\/technet.microsoft.com\/en-us\/library\/cc773263.aspx\" target=\"_blank\">cc773263<\/a> (I&#8217;m not sure, are Technet articles referred to by their number, as KB articles are? So is this Technet 773263?)<\/p>\n<p>Here you can find the<br \/>\n<code>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\W32Time\\Config\\MaxPosPhaseCorrection<\/code> registry setting. It&#8217;s 15 hours for non domain controlled machines &#8211; and &#8220;infinite&#8221; (0xffffffff) for domain controlled hosts.<\/p>\n<p>So set this to 0xffffffff and you&#8217;re set.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1],"tags":[114,120,118,119,117,115,116],"class_list":["post-632","post","type-post","status-publish","format-standard","hentry","category-happy-hacking","category-uncategorized","tag-bios-battery","tag-boot-time","tag-ntpdate","tag-windows","tag-windows-boot-ntp","tag-windows-time","tag-windows-time-at-boot"],"_links":{"self":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=632"}],"version-history":[{"count":3,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=\/wp\/v2\/posts\/632\/revisions\/636"}],"wp:attachment":[{"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valentijn.sessink.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}