Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Run without Dos box
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00139702
Message ID:
00141119
Views:
20
>I remember seeing a technique for doing a RUN command without seeing the DOS window pop up.
>I want to synchronise a client pc to the NT server using
>
run /n net time \\server /yes
>but not see the box.
>BTW, is there another way of doing this seemlessly?

Hi Daivd,

I think we can get you what you want, without much trouble. First, create a shortcut file to a batch file to execute the DOS program you need to use. Open the shortcut's properties dialog, and on the "Program" tab select minimized (just to be sure) and check the "Close on exit" check box. Then, after loading FOXTOOLS.FLL:
m.shllexec = RegFN("ShellExecute", "I@C@C@C@CI", "I", "SHELL.DLL")
m.op = "open"
* Replace this with the acutal name of your shortcut file
m.filename = "SHORTC~1.PIF"
m.parms = ""
* Replace this with the actual directory the executable
* is in
m.dir = SYS(5) + SYS(2003)
m.result = CallFN(m.shllexec, 0, @op, @filename, @parms, @dir, 0)
A return value of greater than 32 indicates that it worked. The last zero parameter in the call will cause the window to be hidden and it will be automatically close. I tested this using a batch file to list a directory to a file, and it worked perfectly.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform