Solved

Batch File: 7x.exe : How to use an exclude filename

Posted on 2010-08-17
7
979 Views
Last Modified: 2013-12-01
Hi there,

How do I add the option of excluting files, by using a text file that will contain the exclusion parameters.  (-x...) (exclude.ini contains: *.mp3, *.wav, *.avi).

"C:\Program Files\7-Zip\7z.exe" -p1234 a -r -mx=9 "Z:\Documents.zip" "C:\Documents\*.*"

Thanks,
Rene
0
Comment
Question by:ReneGe
  • 3
  • 3
7 Comments
 
LVL 7

Expert Comment

by:marektech
Comment Utility
I don't think you can get it to read a .ini file for excluded file types.

You have to specify them in the command, e.g: -x!*.pdf -x!*.doc
0
 
LVL 10

Author Comment

by:ReneGe
Comment Utility
Marektech,

Thanks for helping.

Here is the description of what is required for the command line.

  -x[r[-|0]]]{@listfile|!wildcard}: eXclude filenames

How would i use "-x" to do what I need?

Thanks,
Rene
0
 
LVL 4

Accepted Solution

by:
BasiKobrA earned 500 total points
Comment Utility
Create exclude.ini with each line another exclusion string, for example
*.mp3
*.wav
test*
*.ini

"C:\Program Files\7-Zip\7z.exe" -p1234 a -r -mx=9 "Z:\Documents.zip" "C:\Documents\*.*" -xr@exclude.ini
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 10

Author Comment

by:ReneGe
Comment Utility
Thanks BasiKobrA

Cheers,
Rene
0
 
LVL 10

Author Comment

by:ReneGe
Comment Utility
==>marektech

Oups, sorry... I was to quick in awarding points and miss-clicked your check-box.

I'll give you more points next time to compensate.

Cheers,
Rene
0
 
LVL 7

Expert Comment

by:marektech
Comment Utility
Have you tried:

-x!*.mp3 -x!*.wav -x!*.avi
0
 
LVL 7

Expert Comment

by:marektech
Comment Utility
No problem :) Glad you found a solution
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is an explanation of a simple data model to help parse a JSON feed
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now