![]() |
#1
|
|||
|
|||
![]()
Good day
Please can someone help me to figure out the command to use? I currently have Code:
ShellExecute(Handle, 'open', 'net time \\pdc-fs >c:\ProductionDB\servertime.txt',nil,nil,SW_HIDE); What I am wanting to do is get the time from our server and dump it into a file. Any help is appreciated, thank you. |
#2
|
|||
|
|||
![]()
ShellExecute expects the parameters in the 4th parameter
I would try something like Code:
ShellExecute(Handle, 'open', 'net.exe','time \\pdc-fs >c:\ProductionDB\servertime.txt',nil,SW_HIDE); |
#3
|
|||
|
|||
![]()
Thank you.
I now get a return of 42 (which is >32, so apparently successful), but still no file appearing in the folder...? |
#4
|
|||
|
|||
![]()
It seems this might be by design, see https://connect.microsoft.com/Visual...edirected-file
Instead, must use the following, and this works Code:
ShellExecute(Handle, 'open', 'cmd.exe','/C net time \\pdc-fs >c:\ProductionDB\servertime.txt',nil,SW_HIDE); |
#5
|
|||
|
|||
![]()
ok, didn't know that.
Glad it works now and thank you for providing the solution |
![]() |
Thread Tools | |
Display Modes | |
|
|