Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Synchronise Time with Server
Message
 
 
To
05/09/2003 13:58:45
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00826554
Message ID:
00827115
Views:
23
Mike,
Even though you have an answer already, here is another.

See my FAQ#7903.

Regards.

>My VFP6 App needs to Synchronise to the time of a server (if one is connected).
>The command:
>
>RUN /n NET TIME <servername> /SET /YES
>
>works fine, but flashes up a DOS window.
>So I tried the following - which seems to run, but doesn't actually do the job.
>Can anyone help?
>
>DECLARE INTEGER CreateProcess IN kernel32;
>  STRING    lpApplicationName,;
>  STRING    lpCommandLine,;
>  INTEGER @ lpProcessAttributes,;
>  INTEGER @ lpThreadAttributes,;
>  INTEGER   bInheritHandles,;
>  INTEGER   dwCreationFlags,;
>  INTEGER @ lpEnvironment,;
>  STRING    lpCurrentDirectory,;
>  STRING    lpStartupInfo,;
>  STRING  @ lpProcessInformation
>
> lpApplicationName     = "NET"
> lpCommandLine         = " TIME " + lcServerName + " /SET /YES"
> lpProcessAttributes   = 0
> lpThreadAttributes    = 0
> bInheritHandles       = 1
> dwCreationFlags       = 0
> lpEnvironment         = 0
> lpCurrentDirectory    = "c:\"
> lpStartupInfo         = REPLI (Chr(0), 250)
> lpProcessInformation  = REPLI (" ", 250)
>
>CreateProcess (;
>  lpApplicationName,;
>  lpCommandLine,;
>  @lpProcessAttributes,;
>  @lpThreadAttributes,;
>  bInheritHandles,;
>  dwCreationFlags,;
>  @lpEnvironment,;
>  lpCurrentDirectory,;
>  lpStartupInfo,;
>  @lpProcessInformation)
>
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Reply
Map
View

Click here to load this message in the networking platform