Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to zip the files in XP using the windows default zip utility through command prompt?

share|improve this question

migrated from stackoverflow.com Aug 2 '10 at 12:06

This question came from our site for professional and enthusiast programmers.

    
The zipping feature is a function of the Explorer shell and not exposed any other way. –  Joe Aug 2 '10 at 11:55
1  
I believe that this question should be asked on SuperUser –  DixonD Aug 2 '10 at 11:56
add comment

2 Answers 2

You can't use this tool from the command line in Windows XP.

The best solution would be the free open source tool 7zip, which is very good for creating zip files. I have used this from the command line in XP, and for writing batch files, and it's very good. A simple example:

7za a files.zip *.txt

(this adds all the text files in the current directory to an new archive called files.zip)

There is also the Windows Server 2003 Resource Kit, which can be installed on XP and includes a command line compress, but you will not get such a good result with this (less reliable, worse compression, harder to use and less options)


Edit: Actually, I just found this question, which does have a (somewhat convoluted) way to do this. But they recommend 7zip too.

share|improve this answer
add comment

when i wanted to use zip a file thru command line in the past, i've used 7zip, which comes with a CLI. just add the folder to the PATH.

share|improve this answer
add comment

Your Answer

 
discard

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