Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run WinZip from VFP 1

Status
Not open for further replies.

gogins

IS-IT--Management
Sep 1, 2001
17
GB
Dear All,

I need a to compress a file into a .zip archive file from within a .prg and without screen interaction.

This used to be possible under PKZIP:

PKZIP gogins.zip gogins.dbf

Can anybody help by letting me know what the equivalent
command using WINZIP would be? Can ShellExecute be used?

Many thanks.
 
I've used INfoZip in the past. It's command-line driven and knows about long file names. Something like:
Code:
'---------------------------------------------------
' Create a zip file of the files specified in the
' folder named.
Sub ZipThemUp (strZipFile, strStoredFiles, strFolder)

dim strDestination

Set wsh = WScript.CreateObject("WScript.Shell")
strDestination = strFolder & "\" & strZipFile
wsh.run Chr(34) & "C:\Program Files\infozip\zip" & chr(34) & "-rv" & " " & strDestination & " " & strStoredFiles, 2, True

End Sub

That's VBScript but I don't have a Fox example to hand as I write. It'll be easier in Fox because you can use ! to run it rather than the Scripting Host and you won't have to use CHR(34).

Geoff Franklin
 
Gogins,

This used to be possible under PKZIP

It still is. Provided the user has PKZIP installed, you can use either ShellExecute() or RUN to execute it.

That said, you can also do the job with WinZip. Again, you can use ShellExecute() or RUN. But you will need to install the Winzip Command Line Support add-on,, see
Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top