Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using WinZip
Message
From
06/07/2001 16:44:18
 
 
To
06/07/2001 13:58:31
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00527556
Message ID:
00527640
Views:
52
This message has been marked as the solution to the initial question of the thread.
I'd suggest using Ed Rauh's API_AppRun utility (available here in UT file section) for this type of thing since it allows your program to wait for WinZip to finish and also to check completion status. You don't need the WinZip command line add-on, just build your WinZip command line into a string and pass it to API_AppRun. The code would look something like this, where lcWinZipLoc is the fully qualified path and filename for WinZip32.exe:
if NOT( "PROCESS") $ SET("CLASSLIB")
   SET classlib TO Process ADDITIVE
endif
*   Set up the WinZip command line to extract file. Parameters are:
*   -e = extract
*   -o = overwrite files
*   -j = junk pathnames (i.e., don't use pathnames in zip file, if any)
*   -s = password (case sensitive)

lcWinZipCommandLine = ALLTRIM( lcWinZipLoc) + ;
                      " -e -o -j -sMyPassword " + ;
                      "MyZipFile.zip " + "MyTargetPath"

*   Use Ed Rauh's API_AppRun to launch WinZip and wait for completion, 
*   then check the termination code to see if we succeeded.
oProcess = CREATEOBJ( ;
   "API_AppRun", ;
   lcWinZipCommandLine, ;
   "", ;
   "NOR" ;
   )
*Run the application
wait window nowait "Unzipping files..."
oProcess.LaunchAppAndWait()

*   Show termination status
wait clear
lnStatus = oProcess.CheckProcessExitCode()
oProcess = .NULL.

release classlib process

if lnStatus = 0   && normal termination
   RETURN .T.
else   && abnormal termination
   messagebox(	"Error code " + ALLTRIM( STR( lnStatus)) + ;
                ". The file could not be unzipped.", ;
                MB_ICONEXCLAMATION, "Error")
   RETURN .F.
endif


>I'm trying to extract a zip file via vfp? can anyone tell me why the following does not work?
>
>!C:\Program Files\WinZip\Wzunzip e:\Z44200009.zip
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform