Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1016
  • Last Modified:

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

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
ReneGe
Asked:
ReneGe
  • 3
  • 3
1 Solution
 
marektechCommented:
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
 
ReneGeAuthor Commented:
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
 
BasiKobrACommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ReneGeAuthor Commented:
Thanks BasiKobrA

Cheers,
Rene
0
 
ReneGeAuthor Commented:
==>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
 
marektechCommented:
Have you tried:

-x!*.mp3 -x!*.wav -x!*.avi
0
 
marektechCommented:
No problem :) Glad you found a solution
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now