>Good Morning,
>I would like to synchronize the computer's time with the time of a server on the net that is pointed to the following time: '0.europe.pool.ntp.org'
>I'm using the following command, but it doesn't work, any help is welcome:
>
>DECLARE INTEGER ShellExecute IN shell32.DLL ;
>INTEGER hndWin, ;
>STRING cAction, ;
>STRING cFileName, ;
>STRING cParams, ;
>STRING cDir, ;
>INTEGER nShowWin
>
>ShellExecute(0,"runas","cmd.exe","net stop w32time","",0) && sometimes Admin rights are needed!
>ShellExecute(0,"runas","cmd.exe","w32tm/config/manualpeerlist:0.europe.pool.ntp.org, 0X8, sincfromflags:manual","",0) && sometimes Admin rights are needed!
>ShellExecute(0,"runas","cmd.exe","net start w32time","",0) && sometimes Admin rights are needed!
Aside Al's points
- does the sync not fire itself, I thought Windoofs will sync from time to time.?
- if not, it should not be a problem of VFP, I would place it in Windows Scheduler, there it can run privileged. Installer can do this for you.
- the time sync might fail if computers time is to far away from remote time
In case you try a timestamp based solution on tables. Not a good idea on computers distributed.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]