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
>