Winrar Command Line for Excluding a Directory

sachinkainth

Junior Member
Jul 29, 2014
4
0
0
Hi all,

I have a .bat file in which I have a Winrar command that zips up all the files in a particular folder (
Code:
C:\Data
). I want to zip all the files in this folder plus any files in any subfolders except that I want to exclude a particular subfolder (
Code:
C:\Data\Cobian\Logs
). Here is what my command looks like

Code:
WinRAR a -r -m0 -agYYYYMMDD C:\Users\Sachin\Desktop\ C:\Data -x*\C:\Data\Cobian\Logs -x*\C:\Data\Cobian\Logs\*

You can see that I have attempted to exclude the aforementioned subfolder by using the below option, but the attempted exclusion does not work. The rest of the command works.

Code:
-x*\C:\Data\Cobian\Logs -x*\C:\Data\Cobian\Logs\*
How can I correctly exclude the given folder?
 
Last edited:

ninaholic37

Golden Member
Apr 13, 2012
1,883
31
91
What about?

Code:
-xData\Cobian\Logs
or
Code:
-x*Data\Cobian\Logs
or
Code:
-x*\Data\Cobian\Logs
or
Code:
-xC:\Data\Cobian\Logs