up vote 0 down vote favorite
share [g+] share [fb]

I looked for the answers in the list and did not find any matching.

What is the commandline to zip a file using Winrar, and then move it to a particular folder?

link|improve this question
feedback

migrated from stackoverflow.com Oct 31 '09 at 23:07

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

3 Answers

Though I found no documentation for it, I did manage to use winrar from the command line. I used the following syntax:

winrar a archiveName file1 file2 ....

to create an archive, and

winrar x archiveName

to extract the files from it in the current directory.

link|improve this answer
yes, you can use winrar.exe from the command line with most but not ALL switches and options available to rar.exe – Molly7244 Dec 15 '09 at 17:43
That creates a RAR file, not a ZIP file. – Synetech Aug 15 '11 at 5:59
feedback

WinRAR cannot be used from the command line, use RAR instead.

rar.exe (unlike WinRAR) cannot be used to create a zip archive.

for all possible RAR commands and switches refer to help (rar /?)

but here's how to use zip and unzip on the windows command line.

link|improve this answer
1  
As an alternative you can use 7-zip which, on the command line, can be used to create ZIP archives. As well as Rar, 7z, etc. – Joey Nov 1 '09 at 1:40
+1 for the link to zip.exe and unzip.exe (those Infozip versions need our support). – pavium Nov 1 '09 at 5:54
winrar can totally be used from the command line – Victor Feb 7 '11 at 14:42
feedback

Per sqlsavvy's post on StackOverflow, it is possible to do using winrar.exe from the command line.

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 -df c:\test.zip c:\test.csv

not:

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

I confirm this works, however it pops up a gui progress bar during compress, instead of providing command line output.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown