Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running Extrenal Programs
Message
From
09/02/1999 23:08:10
 
 
To
09/02/1999 22:12:13
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00185803
Message ID:
00185821
Views:
16
>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform