cpathname = "C:\winnt\" inparams = "H:\temp\test.txt" SET CLASSLIB TO PROCESS.VCX ADDITIVE lcCommandline = 'NOTEPAD.EXE '+inparams oProcess = CREATEOBJ('API_AppRun',lcCommandline,cpathname, "NOR") oProcess.LaunchAppAndWait()You can also use WSH http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsMthRun.asp
cpathname = "C:\winnt\" inparams = "H:\temp\test.txt" lcCommandline = 'NOTEPAD.EXE '+inparams oShell = CREATEOBJECT('WScript.Shell') oShell.Run(lcCommandline,,.T.)I would recomend your "file flag" approach as a last resort. You can use Win API Sleep function to wait specified period of time w/o using PC resources.
DECLARE Sleep IN WIN32API Long Sleep(3000) && Delay 3 sec>Sergey,
> cpathname = "K:\SB\SB_RDE\SETSITE55\SBAFaria\" > inparams = ALLTRIM(m.initargetdir) > thisform.hide && hide form > > ***new code.. > SET CLASSLIB TO PROCESS.VCX ADDITIVE > lcCommandline = 'ISPACCTS.EXE '+inparams > oProcess = CREATEOBJ('API_AppRun',lcCommandline,cpathname,'NOR') > oProcess.LaunchAppAndWait() >>Somehow this doesn't work for me. I am almost satisfied with another approach using ShellExecute and waiting for the called EXE to delete a flagfile. But, the processor is making a lot of noise while the do while loop is looking at the flagfile.