I needed to add an IP into the list of internet time servers in the date and time applet (internet time tab) and set that as the default via command line script. After exhaustive research over honestly a number of years I finally came up with the correct command line. It took so long to find the answer because simply adding to the registry never made it appear in the applet. Below is the code.
Code: Select all
Reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers /v "1" /t REG_SZ /d "192.16.1.2" /f
However, there is one issue I face because of this. This deletes whatever timeserver that was currently "1". What can I do to prevent this from happening? Cause usually the first entry is time.windows.com which is not something I want to delete.
To give an example of what my current date and time has in the registry when I export to .reg file
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\DateTime\Servers]
@="1"
"1"="time.windows.com"
"2"="time.nist.gov"
"3"="time-nw.nist.gov"
"4"="time-a.nist.gov"
"5"="time-b.nist.gov"