Solved

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

Posted on 2010-08-17
7
982 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
ID: 33454565
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
ID: 33454589
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
ID: 33454603
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 10

Author Comment

by:ReneGe
ID: 33454609
Thanks BasiKobrA

Cheers,
Rene
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33454640
==>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
ID: 33454664
Have you tried:

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

Expert Comment

by:marektech
ID: 33454669
No problem :) Glad you found a solution
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 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

19 Experts available now in Live!

Get 1:1 Help Now