Search code examples
command-linezipwinrar

How do I make a tarball with winrar from command line


This should be straight forward like it is with 7-zip, but it's not and google is not helping.

I'm doing the following at the command line

rar a -ep1 "C:\Mail\test.zip" "C:\Mail\LastEmail.txt"

and it keeps creating "test.zip" in rar archive format. It needs to be in zip format.

Ultimately I want to make a .tar.gz file.


Solution

  • The text file Rar.txt is the user's manual for console version Rar.exe.

    The second and third paragraph in Introduction chapter at top of this file are:

    RAR supports only RAR format archives, which have .rar file name extension by default. ZIP and other formats are not supported. Even if you specify .zip extension when creating an archive, it will still be in RAR format. Windows users may install WinRAR, which supports more archive types including RAR and ZIP formats.

    WinRAR provides both graphical user interface and command line mode. While console RAR and GUI WinRAR have the similar command line syntax, some differences exist. So it is recommended to use this rar.txt manual for console RAR (rar.exe in case of Windows version) and winrar.chm WinRAR help file for GUI WinRAR (winrar.exe).

    This is also true for free UnRAR.exe which is also a console application.

    WinRAR.chm contains help of WinRAR.exe. On tab Contents there is the list item Command line mode with the Command line syntax page and the lists Commands and Switches. The page about switch -af<type> - specify archive format explains the difference that WinRAR.exe supports compressing and uncompressing ZIP archives with or without using this switch while console version Rar.exe does not support ZIP archives.