WIN7下解决因为Windows Time服务无法启动而造成的时间无法同步问题 2020-08-01 windows 暂无评论 3196 次阅读 在某些情况下,使用了优化工具和清理助手、或者中了木马等,会造成Windows Time服务无法启动,从而造成系统时钟无法与Internet时间服务器同步。 关于Windows时钟无法同步的问题,网络上给出的解决方案基本都是: 1.运行 cmd 进入命令行,然后键入 ``` w32tm /register 正确的响应为:W32Time 成功注册。 ``` 2.如果上一步正确,用 net start "windows time" 或 net start w32time 启动服务,也可以进入计算机管理直接启动Windows Time服务。 3.如果时间同步是服务器的地址有问题,可以把下列文字复制,新建一个文本文档另存为reg文件,双击导入注册表: ``` Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/Windows/CurrentVersion/DateTime/Servers] @="6" "1"="time.windows.com" "2"="time.nist.gov" "3"="time-nw.nist.gov" "4"="time-a.nist.gov" "5"="time-b.nist.gov" "6"="210.72.145.44" ``` 或双击系统托盘下方的时间,在服务器地址栏输入国家授时中心服务器的IP地址(210.72.145.44),然后点击“确定”按钮保存下来就行了。 以上内容来至于互联网络。 在这里需要强调并且解决的是,以上第一条命令:w32tm /register 并非总是能成功的,本人就遇到过几次这种情况。有时候使用w32tm /register 重新注册时间组件时,会提示拒绝访问,无法完成注册,即使是安全模式下也不可行。在这种情况下,如果试图去启动Windows Time服务,会提示无法找到模块而启动失败。当然,在这种情况下,时钟同步肯定不能使用。 下面提供该问题的解决方案,该方案是通过维护本人的WIN7系统得出的,不保证所有情况下都能成功(比如system32目录下的w32time.dll或者w32tm.exe缺失等,此类情况可以通过从其它安装了相同系统版本的计算机上拷贝对应的w32time.dll和w32tm.exe解决)。 我们运行 regedit 打开注册表,定位到:HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time,可以看到几个关键项目,正确的应该是: ``` Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time] "DisplayName"="@%SystemRoot%//system32//w32time.dll,-200" "ImagePath"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,/ 74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,/ 00,76,00,63,00,68,00,6f,00,73,00,74,00,2e,00,65,00,78,00,65,00,20,00,2d,00,/ 6b,00,20,00,4c,00,6f,00,63,00,61,00,6c,00,53,00,65,00,72,00,76,00,69,00,63,/ 00,65,00,00,00 "Description"="@%SystemRoot%//system32//w32time.dll,-201" "ObjectName"="NT AUTHORITY//LocalService" "ErrorControl"=dword:00000001 "Start"=dword:00000003 "Type"=dword:00000020 "ServiceSidType"=dword:00000001 "RequiredPrivileges"=hex(7):53,00,65,00,41,00,75,00,64,00,69,00,74,00,50,00,72,/ 00,69,00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,43,00,68,00,/ 61,00,6e,00,67,00,65,00,4e,00,6f,00,74,00,69,00,66,00,79,00,50,00,72,00,69,/ 00,76,00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,43,00,72,00,65,00,/ 61,00,74,00,65,00,47,00,6c,00,6f,00,62,00,61,00,6c,00,50,00,72,00,69,00,76,/ 00,69,00,6c,00,65,00,67,00,65,00,00,00,53,00,65,00,53,00,79,00,73,00,74,00,/ 65,00,6d,00,54,00,69,00,6d,00,65,00,50,00,72,00,69,00,76,00,69,00,6c,00,65,/ 00,67,00,65,00,00,00,00,00 "FailureActions"=hex:80,51,01,00,00,00,00,00,00,00,00,00,03,00,00,00,14,00,00,/ 00,01,00,00,00,60,ea,00,00,01,00,00,00,c0,d4,01,00,00,00,00,00,00,00,00,00 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/Config] "FrequencyCorrectRate"=dword:00000004 "PollAdjustFactor"=dword:00000005 "LargePhaseOffset"=dword:02faf080 "SpikeWatchPeriod"=dword:00000384 "LocalClockDispersion"=dword:0000000a "HoldPeriod"=dword:00000005 "PhaseCorrectRate"=dword:00000001 "UpdateInterval"=dword:00057e40 "EventLogFlags"=dword:00000002 "AnnounceFlags"=dword:0000000a "TimeJumpAuditOffset"=dword:00007080 "MinPollInterval"=dword:0000000a "MaxPollInterval"=dword:0000000f "MaxNegPhaseCorrection"=dword:0000d2f0 "MaxPosPhaseCorrection"=dword:0000d2f0 "MaxAllowedPhaseOffset"=dword:00000001 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/Parameters] "ServiceDll"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,/ 00,74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,/ 77,00,33,00,32,00,74,00,69,00,6d,00,65,00,2e,00,64,00,6c,00,6c,00,00,00 "ServiceMain"="SvchostEntry_W32Time" "ServiceDllUnloadOnStop"=dword:00000001 "Type"="NTP" "NtpServer"="time.windows.com,0x9" [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/Security] "Security"=hex:01,00,04,80,84,00,00,00,90,00,00,00,00,00,00,00,14,00,00,00,02,/ 00,70,00,05,00,00,00,00,00,14,00,fd,01,02,00,01,01,00,00,00,00,00,05,12,00,/ 00,00,00,00,18,00,ff,01,0f,00,01,02,00,00,00,00,00,05,20,00,00,00,20,02,00,/ 00,00,00,14,00,8d,01,02,00,01,01,00,00,00,00,00,05,04,00,00,00,00,00,14,00,/ 8d,01,02,00,01,01,00,00,00,00,00,05,06,00,00,00,00,00,14,00,9d,01,02,00,01,/ 01,00,00,00,00,00,05,13,00,00,00,01,01,00,00,00,00,00,05,12,00,00,00,01,01,/ 00,00,00,00,00,05,12,00,00,00 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TimeProviders] [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TimeProviders/NtpClient] "DllName"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,/ 74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,77,/ 00,33,00,32,00,74,00,69,00,6d,00,65,00,2e,00,64,00,6c,00,6c,00,00,00 "Enabled"=dword:00000001 "InputProvider"=dword:00000001 "AllowNonstandardModeCombinations"=dword:00000001 "CrossSiteSyncFlags"=dword:00000002 "ResolvePeerBackoffMinutes"=dword:0000000f "ResolvePeerBackoffMaxTimes"=dword:00000007 "CompatibilityFlags"=dword:80000000 "EventLogFlags"=dword:00000001 "LargeSampleSkew"=dword:00000003 "SpecialPollInterval"=dword:00093a80 "SpecialPollTimeRemaining"=hex(7):74,00,69,00,6d,00,65,00,2e,00,77,00,69,00,6e,/ 00,64,00,6f,00,77,00,73,00,2e,00,63,00,6f,00,6d,00,2c,00,37,00,62,00,37,00,/ 38,00,66,00,65,00,36,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,/ 00,00,00,00,00,00,00 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TimeProviders/NtpServer] "DllName"=hex(2):25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,/ 74,00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,77,/ 00,33,00,32,00,74,00,69,00,6d,00,65,00,2e,00,64,00,6c,00,6c,00,00,00 "Enabled"=dword:00000000 "InputProvider"=dword:00000000 "AllowNonstandardModeCombinations"=dword:00000001 "EventLogFlags"=dword:00000000 "ChainEntryTimeout"=dword:00000010 "ChainMaxEntries"=dword:00000080 "ChainMaxHostEntries"=dword:00000004 "ChainDisable"=dword:00000000 "ChainLoggingRate"=dword:0000001e [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TimeProviders/VMICTimeProvider] "Enabled"=dword:00000001 "InputProvider"=dword:00000001 "DllName"=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,/ 74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,76,/ 00,6d,00,69,00,63,00,74,00,69,00,6d,00,65,00,70,00,72,00,6f,00,76,00,69,00,/ 64,00,65,00,72,00,2e,00,64,00,6c,00,6c,00,00,00 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TimeProviders/VMICTimeProvider/Parameters] [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TriggerInfo] [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TriggerInfo/0] "Type"=dword:00000003 "Action"=dword:00000001 "GUID"=hex:ba,0a,e2,1c,51,98,21,44,94,30,1d,de,b7,66,e8,09 [HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TriggerInfo/1] "Type"=dword:00000003 "Action"=dword:00000002 "GUID"=hex:6e,51,af,dd,c2,58,66,48,95,74,c3,b6,15,d4,2e,a1 ``` 如果您的计算机有上述问题,那么会发现注册表中会少那么几项,而且当你试图将缺失的注册表添加进去的时候,可能会发现注册表项拒绝添加! 依次在 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time 的子键上点击右键,选择“权限”,在弹出的对话框中,你可能会看到“组和用户名”一项,只有一个“W32Time”项,问题就出在这里!可以看到,W32Time的注册项没有管理员权限,所以我们进行前面的操作时,都以失败告终。 找到了错误原因所在,那么解决起来就简单了。我们在权限对话框上点击下面的“高级”按钮,在弹出的对话框中的“权限”一栏点击“添加”,再在出来的“选择用户或组”对话框中点“高级”,又会弹出一个“选择用户或组”的对话框,点击中间靠右的“立即查找”,下面会列出本机上的一些用户或组,选择下图所示中对应的用户或组,设置相应的权限(如果不大了解,可以勾选所有权限)。在下图中勾选“使用可从此对象继承的权限替换所有子对象权限”。 ![win7-windows-time.jpg](https://blog.moper.net/usr/uploads/2020/08/3779817077.jpg) 依次按照上面的说明设置好 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time 及其子项的权限,然后刷新注册表,会发现子项中多出了一些项目,需要注意的是,在子项 HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/services/W32Time/TimeProviders 中,应该有三项:NtpClient、NtpServer和VMICTimeProvider,如果有一个类似于xyz的其它项,请删除。 注册表设置好之后,再依次进行最开始所说的那几个步骤,即运行 w32tm /register ,然后启动Windows Time 服务。如果仍然无法成功,请重新启动计算机,并在计算机完全启动后,再运行上述命令。 一般情况下,上述办法可解决Windows Time 时间同步问题。 转自https://blog.csdn.net/piaoyunqing/article/details/6323647 标签: time, ntp 本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。