Can't synchronize time on Windows 7 or save the sync settings
Thursday, October 6, 2011 5:06:59 PM
So for quite some time my Windows 7 has not been synchronizing the computer clock with NTP server. I have not looked into it that much since the error has so far been less than a minute usually. But today I wanted to dig deeper.
So the symptoms were that the clock was not synchronized and trying to manually "update now" would change the status that it is updating with "time.windows.com", but wouldn't ever finish that part. Changing the update server would always error with cannot save changes or some error message like that.
So then I went to Registry Editor and made a search for "time.windows.com" to see where the time sync settings are. That value was found from two places: HKLM\Software\Microsoft\Windows\CurrentVersion\DateTime\servers and HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\DateTime\servers.
The latter is the location given to 32-bit applications when they request the data for the former path. So obviously the server list existed for both 32 and 64 bit systems. Well, since my Windows is 64-bit version, the time module would also be 64-bit, so just randomly I tried deleting the one from syswow path. Surprisingly, the time synchronization tab disappeared completely! But it shouldn't use that path...
Checking with Process Explorer I noticed that even though the command line to start the app was
"C:\Windows\system32\rundll32.exe" Shell32.dll,Control_RunDLL "C:\Windows\system32\timedate.cpl",
the path to the executable running was "C:\Windows\SysWOW64\rundll32.exe". So Windows actually started the 32-bit version of the wrapper executable even though the 64-bit one was requested!
So I tried myself running it like that, same thing happened. Then I tried running the .cpl file directly from System32, still same thing happened. Then I went to look how the .cpl file is associated to run. Something striking my eye in HKCR\cplfile\shell\open: "C:\Windows\SysWOW64\control.exe". Now that doesn't seem right, all control panel apps would be launched through the 32-bit version of Control Panel handler? So I just changed that to open the control.exe from System32 and like magic everything started working right. rundll32.exe would be running in 64-bit mode, time synchronization worked and setting custom time server was no problem either.
So in case you have a problem setting the time synchronization settings in a 64-bit Windows, one possible problem might be that for reason yet unknown the cplfile handler is set to 32-bit executable and changing it to 64-bit in registry manually fixes the problem. Now if someone has any idea what changed it to wrong path initially, please write in comments. Would be great to know.