Switch -X<file> - exclude specified file


Exclude specified file from operation, wildcards may be used both in the name and file parts of file mask. You may specify the switch -x several times on the same command line.

If mask contains wildcards, it applies to current folder and its subfolders. It is not recursive without wildcards, so if you wish to exclude some "filename" in all folders, you need to specify two masks: "filename" for current folder and "*\filename" for subfolders. If you know an exact path to file, you can use "path\filename" syntax to exclude only this copy of "filename". If you use -xpath\filename syntax when unpacking an archive, "path" must be a path inside of archive, not a file path on the disk after unpacking.

Examples

  1. add all *.exe files, except those beginning with f, to the archive bin

WinRAR a -xf*.* bin *.exe

  1. compress all files on the disk c: except temp folders and files inside of temp folders

WinRAR a -r -x*\temp -x*\temp\* savec c:\*

  1. extract all files except *.txt from docs.rar

WinRAR x -x*.txt docs

See also: