Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Executing a dos command from VFP6
Message
From
26/01/2002 16:12:38
Ken Dibble
Southern Tier Independence Center
Binghamton, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00610938
Message ID:
00611139
Views:
18
Hi David,

I'm using this to run the DOS compression program lha.exe. The code below causes the program to execute successfully, but it won't release the modal state when it's done executing, almost as though there is an invisible DOS window that must be closed first. The Windows Task Manager shows an instance of "winoldap" running. Once winoldap is killed, the VFP app regains control and continues on.

So is there a scripting command to cause a modal process to release when it's finished? I want to see if the compressed file was created and give the user a message yea or nay. Without the modal state, my file check occurs before lha is done so it always returns .F. I can fudge this with a WAIT "" TIMEOUT n but, of course, there's no reliable way of predicting how long n should be.

TIA

Ken Dibble

There's also an easy way with the scripting host:
>
>
lparameter pcProgram, pcArguments, pnShowWindow, plModal
>
>local loShell, lnRetVal
>
>loShell = createobject( "wscript.shell" )
>lnRetVal = loShell.Run( pcProgram + " " + pcArguments, pnShowWindow, plModal )
>return lnRetVal
>
Previous
Reply
Map
View

Click here to load this message in the networking platform