Post

7 Zip exclude multiple files and directories

Argument list

  • a – Add to archive

  • t7z – type of archive, in this example, it uses 7z

  • xr@ – specify the exclusion list.

Examples

Adds to the archive.7z all files from Folder1 and its subfolders, except *.png files.

1
2
7z a archive.7z Folder1\ -xr!*.png

To exclude the list of directories and files, you can first store the items in a text file separated by new line for each, then run the following command

1
7z.exe a -t7z archive.7z C:\Project\Solution1 -xr@exclusionList.txt

Happy Coding! 😇

This post is licensed under CC BY 4.0 by the author.

Comments powered by Disqus.

© Vincent. Some rights reserved.