Jack,
ShellExecute() can not provide modal execution. If the WindowsScripting Host is available the code below will work.
>Running into a problem that I cannot find a solution for. In order to run a particular executable from a .prg file over a network without mapping a drive letter (using a UNC path), I need to run the program file from shellexecute. No problem there. The problem comes from the fact the Visual FoxPro wants to just keep going before the program shellexecute started finishes. I need a way to allow the program (pkzip) to complete without the user having to hit a key (required with the wait command.)
>
>Question... Is there a way to allow the shellexecute command to finish before the .prg file continues? Without having to use WAIT?
function RunProcess( pcProgram, pcArguments, pnShowWindow, plModal )
local loShell, lnRetVal
if type('pcArguments') != 'C'
pcArguments = ""
endif
loShell = createobject( "wscript.shell" )
lnRetVal = loShell.Run( pcProgram + " " + pcArguments, pnShowWindow, plModal )
return lnRetVal
If you can't use the WSH, look for a FAQ here written by Ed Rauh that gives another API call you can make.