use winrar command line to create zip archives

Frangiskos picture Frangiskos · Sep 30, 2010 · Viewed 81.4k times · Source

I'm using the following winrar command line to create zip archives:

rar.exe a -df -ep -ag[yyyyMMddhhmmss] -ms[txt] C:\MyZipFile.zip C:\tmp\MyFiles*.txt

The archives created are in RAR format instead of ZIP. Is there a way to create regular ZIP and not RAR archives?

Answer

sqlsavvy picture sqlsavvy · Dec 16, 2010

Make certain you are using WinRAR.exe and not Rar.exe.

If you are using the command line to do this make sure you type:

winrar a -afzip c:\test.zip c:\test.csv

not:

a -afzip c:\test.zip c:\test.csv

It works for me. I also got it to work in SSIS.