Here's my directory structure (in Windows 8.1):
parentdir\ child1\ child2\ grandchild1\ grandchild2\ grandchild3\ ... child3\ child4\ ...
Using 7-Zip on commandline, I am trying to automate a compression script to archive all the content of
parentdir into parentdir.zip.
In the resulting archive, I need to exclude all the content of
I could have gone for:
7z a -r parentdir.zip parentdir\* -xr!child2\grandchild2 -xr!child2\grandchild3, etc.
Problem is there may be any number of grandchildren!
Again, I toyed with something like:
7z a -r parentdir.zip parentdir\* -xr!child2\* -ir!child2\grandchild1\*
The command ran nicely, completely ignoring my second (include) switch.
So, can I actually use both include and exclude switches on the same line? If yes, how? And if not, how can I achieve the goal I just described above, on my directory tree?