If you are using the command prompt (cmd.exe, as opposed to PowerShell), here's something you might be able to try: C: && cd C:\Automate && for x in *.* do "C:\Program Files\7-zip\7z.exe" a C:\Archive\%x%.zip %x% You could probably do something vaguely similar with the PowerShell, but I wouldn't know how, as I'm only familiar with cmd, and certain un*x shells.
Typically, p7zip's executable binaries are located in /usr/share/lib/p7zip, /usr/local/share/lib/p7zip, /usr/lib/p7zip, or somewhere similar (depending on how it was packaged, and/or whether you built it from source yourself), with the 7z.so library file being in the same location. Since this location is not likely to be in the PATH variable, these binaries come with shell scripts to pass arguments to commands with explicit arguments. For instance: #! /bin/sh exec /usr/lib/p7zip/7z "$@" The above...
This sounds like the kind of usecase that the unix program xargs was meant for. Try the following: find ./123 -type f \( -iname '*.txt' -o -iname '*.txt1' \) -printf "%p\0" | xargs -r -0 7z a -p'1123123' -m0=lzma2 -mx=9 -mfb=64 -md32m -ms=on -mhe=on $archive_title.7z; You might need to add a -s [number] argument to xargs before the 7z argument if you have a lot of files being read from stdin, or else xargs will call 7z multiple times, processing a different batch of files each time, which would create...
This sounds like the kind of usecase that the unix program xargs was meant for. Try the following: find ./123 -type f \( -iname '*.txt' -o -iname '*.txt1' \) -printf "%p\0" | xargs -r -0 7z a -p'1123123' -m0=lzma2 -mx=9 -mfb=64 -md32m -ms=on -mhe=on $archive_title.7z; You might need to add a -s [number] argument to xargs before the 7z argument if you have a lot of files being read from stdin, or else xargs will call 7z multiple times, processing a different batch of files each time, which would create...
This sounds like the kind of usecase that the unix program xargs was meant for. Try the following: find ./123 -type f \( -iname '*.txt' -o -iname '*.txt1' \) -printf "%f\0" | xargs -r -0 7z a -p'1123123' -m0=lzma2 -mx=9 -mfb=64 -md32m -ms=on -mhe=on $archive_title.7z; You might need to add a -s [number] argument to xargs before the 7z argument if you have a lot of files being read from stdin, or else xargs will call 7z multiple times, processing a different batch of files each time, which would create...
You could try writing your archive to stdout, and redirecting it to a file. Of course, I say this on the assumption that the archive you're trying to write supports this (the *.7z file format doesn't, AFAIK). I find this particularly useful when crating xz-compressed tar files: tar cf - some_directory | 7za a . -si -so -txz > some_file.tar.xz This will allow you to overwrite files without 7za even knowing that it is overwriting files. Of course, you won't get any "are you sure you want to overwrite...
You could try writing your archive to stdout, and redirecting it to a file. Of course, I say this on the assumption that the archive you're trying to write supports this (*.7z files don't, AFAIK). I find this particularly useful when crating xz-compressed tar files: tar cf - some_directory | 7za a . -si -so -txz > some_file.tar.xz This will allow you to overwrite files without 7za even knowing that it is overwriting files. Of course, you won't get any "are you sure you want to overwrite this file?"...