- 帖子
- 1282
- 积分
- 723
- 技术
- 13
- 捐助
- 50
- 注册时间
- 2010-4-18
|
net time 可以不?
apang 发表于 2014-10-10 22:22
http://www.cnblogs.com/hfzsjz/archive/2011/01/05/1926536.html
1、服务器端,运行。
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer /v Enabled /t REG_DWORD /d 1 /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\Config /v AnnounceFlags /t REG_DWORD /d 5 /f
echo setup w32time auto startup
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time /v Start /t REG_DWORD /d 2 /f
net stop w32time && net start w32time
2、客户端,运行
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollInterval /t REG_DWORD /d 30 /f
reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient /v SpecialPollTimeRemaining /t REG_MULTI_SZ /d 192.168.1.1,0 /f
echo setup w32time auto startup
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W32Time /v Start /t REG_DWORD /d 2 /f
set TimeServer=192.168.1.1
net time /setsntp:%TimeServer%
net stop w32time && net start w32time
w32tm /resync |
|