3

I think the header explain the question. I want to do inside a bat-file:

zip /a /m myfile.log myarchive.zip

where I just invented the zip comand and the options: /a add file /m Move file

It is run on Windows Server 2003.

2 Answers 2

4

you need to use an actual implementation of a zip program. take a look at gzip, bzip or 7zip. Each program will have different command line switches

2

I've used 7-Zip in batch files, this line for example compresses all *.bak files in a given folder:

FOR /f %%i in ('DIR /b D:\Backup\*.bak') DO "C:\Program Files\7-Zip\7z.exe" a -tbzip2 -mx3 D:\BackupCompressed\%%i.7z D:\Backup\SQLDaily\%%i

You have to download the right version of 7-Zip for your operating system (32 or 64 bit and use the 7z.exe).

Here is the link to a page with command line examples.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .