Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I can compress files or folders in Windows from GUI by right clicking and selecting "Send to .. Compressed (zip) file..".

Is it possible to do same in batch file?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

I have very good experience using 7-Zip. It's open source and does an outstanding job of compression. Lots of formats and strong encryption if you need it. It has both GUI and command line versions.

share|improve this answer
    
+1, LZMA2 gives the best compression (on average, for general files) available right now. –  Chris S Apr 24 '10 at 2:40

Your best option would be to head over to 7Zip.org, go to the download section and get the '7-Zip Command Line Version'. It supports most compression formats, is easy to use and free! A command line example to compress a bunch of files with the bak extension to ZIP format would be:

7za a -tzip tinybak.zip *.bak
share|improve this answer

You can use compress.exe which is built into windows, but WinRar is free and has command line based tools which I would recommend.

share|improve this answer
    
compress.exe only supports NTFS file systems and I believe it is a separate download (comes with the Windows Server 2003 Resource Kit etc) –  Chris Driver Jun 9 '09 at 13:07
    
WinRar is not free. As of today it's $29/license with lower prices for volume purchases. rarlab.com/shop2rarlab.php?prod=winrar –  squillman Jun 9 '09 at 13:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.