Synchronize Time via the Network

by Johannes Helmig [Published on 5 July 2000 / Last Updated on 5 July 2000]

When sharing files on a network ( especially when sharing a database ), it is important
that all systems using the network use the same time (not having their clocks off by several
minutes or more)
.
Windows provides an easy method to keep the system clocks synchronized using the
option "TIME" of the NET-command (to display the syntax of this command, open a
Command-windows ["DOS-box"] and type: NET TIME /? ):



You use the "NET TIME" command in a Command-window ("DOS-box") or
in a BATCH-file:

In the most basic format, NET TIME displays just the Date/Time of the system
clock of the specified computer. The option " /SET" stores this Date/Time info
to your local system-clock ("Synchronizes the time"), still prompting you to confirm
this adjustment. Defining the option " /YES" will synchronize the time without the prompt.


When connecting to a Windows NT-server, the NET TIME-command is usually
part of the Logon-script.

In a workgroup-network ("peer-to-peer" without an NT-server ) :
To automate this synchronization, use NOTEPAD to create a BATCH-file
( I stored / named the file "C:\synctime.bat" ) containing the line:
NET TIME \\computer /SET /YES

Then create in the STARTUP-folder a short-cut to this BATCH-file
( right-click on an unused part of your Windows taskbar, select "Properties", then select
the tab: "Start Menu Programs", click on "Advanced", locate the folder "STARTUP" in
"Start Menu" / "Programs", click on it, then drag with the RIGHT-mouse-button the icon
of the BATCH-file to this folder, on releasing the mouse-button select "Create Shortcut"):



Right-click on the Shortcut to the
BATCH-file and select "Properties".
tab: Program

To avoid a command-window to
show up and to stay on the screen,
select to: Run : Minimized
and also to

See Also

Featured Links