Command line syntax

Previous  Top  Next


It is possible to perform WinRAR commands from the command line. Common command line syntax is described below:


WinRAR <command> -<switch1> -<switchN> <archive> <files...> <@listfiles...> <path_to_extract\>

command       Character combination denoted function to be performed by WinRAR   
switch       Switches used to define a specific type of operation, compression strength, type of archive, etc.   
archive       The name of the archive to process.   
Files       The name(s) of files to be processed.   
Listfiles       Listfiles are plain text files that contain names of files to process. File names should start at the first column. It is possible to put comments to the listfile after // characters. For example, you may create backup.lst containing the following strings: c:\work\doc\*.txt      //backup text documents c:\work\image\*.bmp      //backup pictures c:\work\misc and then run: winrar a backup @backup.lst You may specify both usual file names and list files in the same command line.   
Path_to_extract       Used only with commands e and x, indicating the folder in which to place extracted files. If this folder does not exist, it will be created.   



Notes

a) If neither files nor listfiles are specified, then *.* is implied and WinRAR will process all files;

b) If archive extension is not specified, WinRAR will use the default archive format selected in the default compression profile, but you may override it specifying either .RAR or .ZIP extension;

c) switches entered on the command line override the same configuration settings;

d) for commands c, e, s, t, rr, k and x wildcards may be used in the archive name. Thus it is possible to process more than one archive with a single command. Moreover, if you specify -r switch with these commands, they will search for archives in subfolders;


e) some commands and switches are applicable only to RAR archives, some both to RAR and ZIP and some to all archive formats. This is dependent upon the functionality provided by the archive format;

f) commands and switches are not case sensitive, you may write them both in upper and in lower case.