Solved

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

Posted on 2010-08-17
7
988 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

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.

Question has a verified solution.

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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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 …

773 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