7z.exe: catastrophic archiving entire drive or missing name of source...
A free file archiver for extremely high compression
Brought to you by:
ipavlov
Attached you will find a test script with three examples for archiving a subfolder in batch mode with 7z.exe.
The details are explained in the comments in the script.
It works fine for sub-subdirectories. However, if the directory is located directly in the root directory of a drive, the name of the source directory is missing from the archive, or 7z.exe attempts to back up the entire drive. That would be a disaster. I am sure this is a bug.
Thank you very much for your efforts.
read
-rswitch description in help file and look all command examples from that help page.Last edit: Igor Pavlov 2026-01-01
Okay, without the "-r" option, example 3 now works as desired. The name of the source directory from the top level is inside the archive.
However, I cannot explain why in example 3 (with "-r") the entire drive was searched, but in example 1 (also with "-r") it wasn't. But never mind.
Thank you for your prompt reply.