>I have stored a complete file path in a field called docs.file_name. If I want to open the file stored in docs.file_name with notepad, what code would accomplish this?
>
>! /N c:\winnt\notepad.exe ????????????????
You might want to look at using my API_APPRUN class rather than the native VFP run; it gives you better control over the Window mode over the application, and can force VFP to wait on the process started by the class before returning to VFP. You'd use it as follows:
SET CLASSLIB TO PROCESS
oProc = CREATEOBJ('API_APPRUN','C:\WINNT\NOTEPAD.EXE ' + docs.File_name,,'MAX')
* The above sets up to run notepad in the CWD against the file
* and maximize the Notepad window at startup
oProc.LaunchAppAndWait
You can monitor a running app for termination, and check the process completion code as well. It's available for download here on UT.