r/Batch • u/Equivalent_Meaning46 • Sep 22 '26
Recursive option with 7zip
How does recurse work on 7zip CMD line ?
1
u/capoapk Sep 22 '26
Pour chercher des fichiers précis partout (par exemple, tous les .txt), ajoutez simplement -r à la fin de la commande
1
u/Equivalent_Meaning46 Sep 22 '26
English please
1
u/capoapk Sep 22 '26
To search for specific files everywhere (for example, all .txt), simply add -r at the end of the command
1
u/Equivalent_Meaning46 Sep 22 '26
What if I dont want to recurse from a particular folder ? How to use ?
1
u/capoapk Sep 22 '26
7z a archive.7z MonDossier\ -x!MonDossier\DossierAExclure\
1
u/Equivalent_Meaning46 Sep 22 '26
But this only excludes one particular named folder what about all subfolders ??
1
u/capoapk Sep 22 '26
7z a archive.7z C:\MonDossier\* -x!*\
1
u/Equivalent_Meaning46 Sep 22 '26
Do I have to use
7z a archive.7z C:\MonDossier\* -x!*\or can I use7z a archive.7z C:\MonDossier -x!*\???2
Sep 22 '26
[removed] — view removed comment
1
u/Equivalent_Meaning46 Sep 22 '26
Believe me, I have looked non stop everywhere and tried every possible combination of switches and posted on 7zip sourxeforge page too, the author's English is very bad and he does not communicate well about why he chose recurse to behave the way he wants to it's reaaaally counterintuitive
3
u/BrainWaveCC Sep 22 '26
You would undoubtedly find it far more productive if you told us exactly what you were trying to accomplish -- the in the weeds version, not the 30,000 foot version -- and we could probably give you an answer without running to almost 20 responses.
I've done lots of recursion with 7zip, and knowing what you are trying to do would be better than answering generically about a feature that actually exists.
2
u/pc1350 Sep 22 '26
Check help file. Very useful.