Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program Control
Message
From
25/02/1999 14:40:02
 
 
To
25/02/1999 13:34:45
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00191551
Message ID:
00191581
Views:
13
>I need to run pkzip25 from VFP 5.0a.
>When I try to do it with a pif, it errors out (maybe I am doing it wrong). When I use ! /N, I don't know when it is completed. What can I do? Thanks.
>

You might try using my API_APPRUN class, available in the File Section here on UT. It has a LaunchAppAndWait method, which will cause VFP to wait until the launched program completes, or you can use the LaunchApp method and then poll the completion code for the launched app using the CheckProcessExitCode method, which picks up the termination code from the launched app (the app has finished running when CheckProcessExitCode returns a value other than 259). It also can run PKZIP hidden or minimized, with no ugly DOS box visible.

A number of people have used it with PKZIP in the past without problems, so I know it works. Assuming that you've got PKZIP somewhere in the windows search path, the following command would create a ZIP file named EXAMPLE.ZIP in the current working directory from the files in another directory C:\ZIPThese, with PKZIP running minimized (it'll show up on the task bar, but not pop a DOS box in the middle of the screen):
SET CLASSLIB TO Process
oZipCmd = CREATEOBJ('API_APPRUN','PKZIP EXAMPLE C:\ZIPThese\*.*',,'MIN')
oZipCmd.LaunchAppAndWait
? 'PKZIP terminated with an exit code of ',oZipCmd.CheckProcessExitCode
oZipCmd=''
You may have to flag PKZIP to close on exit; this is done by going into Explorer, right-clicking on PKZIP.EXE, selecting the Properties option from the pop-up menu, and checking the Close on Exit checkbox under the Program tab.

Good luck!
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
Next
Reply
Map
View

Click here to load this message in the networking platform