admin 管理员组

文章数量: 887021

Windows XP 客户端时间更新脚本NTP

::Windows XP 客户端时间更新脚本NTP  
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /ve /t REG_SZ /d 3 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 1 /t REG_SZ /d time.windows /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 2 /t REG_SZ /d time.nist.gov /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 3 /t REG_SZ /d time1.aliyun /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v NtpServer /t REG_SZ /d time1.aliyun /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /v SpecialPollInterval /t REG_DWORD /d 3600 /f
sc config w32time start= auto
net time /setsntp:time1.aliyun
ping -n 3 127.0.0.1 >nul
net stop w32time
ping -n 3 127.0.0.1 >nul
net start w32time
ping -n 3 127.0.0.1 >nul
w32tm /resync

Windows 7,10 客户端时间更新脚本NTP(管理员身份运行)

::Windows 7,10 客户端时间更新脚本NTP(管理员身份运行)  
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /ve /t REG_SZ /d 3 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 1 /t REG_SZ /d time.windows /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 2 /t REG_SZ /d time.nist.gov /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers" /v 3 /t REG_SZ /d time1.aliyun /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Parameters" /v NtpServer /t REG_SZ /d time1.aliyun /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient" /v SpecialPollInterval /t REG_DWORD /d 3600 /f
sc config w32time start= auto
ping -n 3 127.0.0.1 >nul
net stop w32time
ping -n 3 127.0.0.1 >nul
net start w32time
ping -n 3 127.0.0.1 >nul
w32tm /config /manualpeerlist:"time1.aliyun" /syncfromflags:manual /reliable:yes /update
ping -n 3 127.0.0.1 >nul
w32tm /resync

本文标签: 脚本 客户端 时间 Windows ntp