#47638 - 2003-11-07 02:52 PM
Re: Shelling Net Time
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Doesn't the KiXtart native command SETTIME work?
Kent
|
Top
|
|
|
|
#47647 - 2003-11-07 04:23 PM
Re: Shelling Net Time
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Cannot "push" out W32Time?
Try this out - code:
;Time installation :timeserv IF @dos >=5 ; Don't do the whole process on Windows 2000/XP SETTIME @ldomain ; Sync the local clock RETURN ELSE IF exist($systemdrive+'\w32update.ok') RETURN ELSE ;Has this been setup? IF KEYEXIST('HKLM\System\CurrentControlSet\Services\W32Time')=0 ;Check for Time files IF 0=EXIST($windir+'\SYSTEM32\w32time.exe') COPY @ldrive+'Reskit\TimeService\W32Time\company\Secondary\w32time.exe' $windir+'\SYSTEM32' ENDIF IF 0=EXIST($windir+'\w32time.ini') COPY @ldrive+'Reskit\TimeService\W32Time\company\Secondary\w32time.ini' $windir ENDIF ;Execute the time service to start automatically RUN $windir+'\SYSTEM32\w32time.exe -automatic' ;Have to add a small pause to start the service SLEEP 1 ;Execute a Net Start to Start the Service SHELL '%COMSPEC% /C NET START W32TIME > nul' SLEEP 1 SHELL '%COMSPEC% /C w32time.exe -update > nul' COPY $drive+'\system32\config.nt' $systemdrive+'\w32update.ok' ;CLS RETURN ELSE ;?'Updating Time Service.. One moment please' SHELL '%COMSPEC% /C net stop w32time > nul' SLEEP 1 SHELL '%COMSPEC% /C w32time.exe -remove > nul' SLEEP 1 SHELL '%COMSPEC% /C w32time.exe -automatic > nul' SLEEP 1 SHELL '%COMSPEC% /C net start w32time > nul' SLEEP 1 SHELL '%COMSPEC% /C w32time.exe -update > nul' COPY $windir+'\system32\config.nt' $systemdrive+'\w32update.ok' RETURN ENDIF ENDIF RETURN ENDIF
It is some really old code I have lying around and probably needs to be cleaned up.
Kent [ 07. November 2003, 16:24: Message edited by: kdyer ]
|
Top
|
|
|
|
#47652 - 2003-11-07 04:46 PM
Re: Shelling Net Time
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Why can't you deploy w32time? That is best and easiest way aroudn this. You can have it re-sync several times a day too (especially with large db files, etc.)
Kent
|
Top
|
|
|
|
#47654 - 2003-11-07 04:54 PM
Re: Shelling Net Time
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Script runs all from the server as the user running it.
Kent [ 07. November 2003, 16:54: Message edited by: kdyer ]
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 262 anonymous users online.
|
|
|