Creating an archive from a directory without the directory name being added to the archive
Problem
I have the following folder structure: root folder1 folder2 folder3 7za.exe I want to run the 7-zip command line tool to compress all the files in to a zip file called . Running the following produces a zip file as expected. However, when I open the zip file, it has a folder in it called , and inside that I have all the files that were inside that folder. I don't want the folder name added to the zip folder, i.e. I would like to add all the files in a "Flat" file format. I also don't want to recursively run the command line tool for each individual file/folder. Is there a switch that provides this functionality?
Error Output
7za.exe a -tzip folder1.zip folder1\\*.*
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: Creating an archive from a directory without the directory name being added to the archive
From the 7-Zip Help file: a (Add) command Adds files to archive. Examples adds all files and subfolders from folder subdir to archive archive1.zip. The filenames in archive will contain subdir\ prefix. adds all files and subfolders from folder subdir to archive archive2.zip. The filenames in archive will not contain subdir\ prefix. The filenames in archive c:\archive3.zip will contain dir2\dir3\ prefix, but they will not contain c:\dir1\ prefix. So the command you'd want would be: Also, pay att…
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix