>With the purpose to syncronize the clock of client-machine with the clock of an Windows-NT Server, I´m using the next line in the Main program of my Client/Server application:
>
>RUN 'c:\windows\net time \\srvax /set /yes'
>
>After the Netsetup process, and when the application is executed by a client, an error appears. It seems no client can execute a program with the RUN command.
>
>¿Anybody knows how can I achive this purpose? I'll appreciate your help!!!
You've got the command line syntax wrong:
RUN /N C:\WINDOWS\NET TIME \\SRVAX /SET /YES
Notice, no quotes. It's a WinApp, not a DOS app, so it should be run with an appropriate /N; you can avoid the DOS Window appearing. Also,NET.EXE is not always in the C:\WINDOWS directory (under NT and Win2K, it's in the SYSTEM32 folder), and the syntax does not always support the /YES switch.
On my Win2K box here, it's found in F:\WinNT\SYSTEM32 - I installed Win2K on the F: drive, and there is no \WINDOWS folder at all.
Since it is in the Windows search path, it's best to omit the full path to allow Windows to run it from whereever it is on the Windows system in use.
RUN /N NET TIME \\SRVAX /SET /YES
VFP expects to find a FOXRUN.PIF file to establish the execution environment; failing to include that can cause the RUN command to fail.
You can download my API_APPRUN class from the Files Section; it's a class that permits greater flexibility in executing an external application and is not dependent on the FOXRUN.PIF at all. It also can be used to either launch an app asynchronously, or to wait on the external app to complete before return control to the VFP app.
>
>Enrique