Download the Flash player at www.macromedia.com.
Home
Solutions
Solution Archives
Software Products
Site Search

 

03-Apr-05, ZWDynaUser Article posted! (Pt. 1)

28-Mar-05, Windows Process Authority article posted!

28-Mar-05, ZWXPDrive article posted!

22-Mar-05, ZENworks Enhancement Software Posted!

22-Mar-05, Site Updated!

Legacy Article - Information may be dated.

 

KEEPING NT STATIONS TIME IN SYNCH

Some NT workstations and servers are left running for an extended period of time and thus their time can tend to drift from the time on your Novell Servers.  On Win95 or DOS stations, you could schedule the systime (From NW4.11 or earlier - stills works w/NW5) utility to resynch the time on the workstation.  On NT boxes, however, this will report the current time and even say the time has been changed, but alas the time on the NT box will not have changed.   Below is a procedure which will allow the systime to function on an NT station with the help of two shareware utilities.

The process is quite simple.  Use the systime utility to redirect the current time into a text file and then use some file parsing utilities to extract just the current time from that file.  Then pass the time to WinNT's "time" utility which can change the system time from the command prompt.  Simply schedule the batch file below with either Novell's scheduler or the AT scheduler too keep the time in synch for those stations or servers that rarely reboot.   (See the WS Mgr section on how to get the AT scheduler to access NW resources.)


MD C:\NWTIME
F:\utils\systime >C:\NWTIME\TIME.TXT

F:\utils\fgrep.com monday c:\nwtime\time.txt
if errorlevel 1 goto 6

F:\utils\fgrep.com tuesday c:\nwtime\time.txt
if errorlevel 1 goto 7

F:\utils\fgrep.com wednesday c:\nwtime\time.txt
if errorlevel 1 goto 9

F:\utils\fgrep.com thursday c:\nwtime\time.txt
if errorlevel 1 goto 8

F:\utils\fgrep.com friday c:\nwtime\time.txt
if errorlevel 1 goto 6

F:\utils\fgrep.com saturday c:\nwtime\time.txt
if errorlevel 1 goto 8

F:\utils\fgrep.com sunday c:\nwtime\time.txt
if errorlevel 1 goto 6

:6
F:\utils\fcut.exe /p1 /b37 c:\nwtime\time.txt c:\time\out.001
goto end

:7
F:\utils\fcut.exe /p1 /b38 c:\nwtime\time.txt c:\time\out.001
goto end

:8
F:\utils\fcut.exe /p1 /b39 c:\nwtime\time.txt c:\time\out.001
goto end

:9
F:\utils\fcut.exe /p1 /b40 c:\nwtime\time.txt c:\time\out.001

:end

time <c:\time\out.001


The batch file accomplishes its task by performing the following steps.

1)  Getting the current Day and Time via the systime utility and storing the value in the c:\nwtime\time.txt file.
            (Ex. Current system time: Friday 12/10/99 7:55:49 am)
2)  Using a grep utility to determine the day of the week.  (This is necessary to set the correct offset)
3)  Use a file cut utility to remove the front of the string modified to account for the length of the "day" substring.
4)  Pass the remaining substring, which is the current time, to the internal WinNT "time" command.

Below are copies of the two freeware utilities I used for the example above.

http://www.ithowto.com/ftp/fcut.exe
http://www.ithowto.com/ftp/fgrep180.zip