7 Zip exclude multiple files and directories


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

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

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

a – Add to archive

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

-xr@ – specify the exclusion list.

Happy Coding!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s