Link to home
Start Free TrialLog in
Avatar of jennifere
jennifere

asked on

Unzip a zip file

Is there an easy way to unzip a file.  Here is my code.  It downloads the file fine but is not extracting it.  Am I doing this right or is there an easier way??

FTP.Get('officesOFFICES.zip', 'C:\CSS\RETS\CharlestonOffice.zip', true, true);
ZipFile := 'C:\CSS\RETS\CharlestonOffice.zip';
cmd:='/c c:\discod\discoc\sys\zipx '+ZipFile;
ShellExecute(Application.handle,'open','command',PChar(cmd),nil,SW_SHOW);

Avatar of BedouinDN
BedouinDN

I've never used ZipX so I don't know anything about the command line parameters you are using to open the archive file, however, if you don't mind using components rather than relying on another application there are a large amount of freeware objects you can use that will give you better control over the archive.

A good one I have used in the past is TurboPowers Abbrevia component set, this can be downloaded from SourceForge (as it's now open source) at:  http://sourceforge.net/projects/tpabbrevia/

Cheers.
:-)

ASKER CERTIFIED SOLUTION
Avatar of esoftbg
esoftbg
Flag of Bulgaria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jennifere

ASKER

That works perfect.  Thanks!
Glad to help.