7za a -t7z -mmt -mx9 -y Include.7z .\Include\*
The above command adds the files to the 7z archive, but what if I want them in a custom subfolder?
For example Files\ inside .7z
7za a -t7z -mmt -mx9 -y Include.7z .\Include\*
The above command adds the files to the 7z archive, but what if I want them in a custom subfolder?
For example Files\ inside .7z
It appears that the developer himself has answered this question when you asked him:
Now there is no option for that task.
You can use additional "rn" (Rename) command to rename folder inside archive.
By experimenting, I found that alternatively, you can create the folder structure that you want to be added. Let your "staging area" refer to the place on your filesystem where you prepare the files/folders to be added... For your example, you could
Include folder in your staging area.a command in 7za a... means "add to archive", so it's the same command whether or not the archive exists yet.)Using this method,
Try this:
"C:\Program Files\7-Zip\7z.exe" a C:\deploy\TOP.ear C:\apps\temp\entidadejar\lib
Add the folder lib in TOP.ear, if a subfolder exists, the 7z will add the files inside the subfolder lib.
.) after C:\apps\temp\entidadejar\lib meant to be part of the command, or was it just the end of the sentence?
– Scott - Слава Україні
Aug 30 '18 at 18:31
.) after C:\apps\temp\entidadejar\lib meant to be part of the command, or was it just the end of the sentence?
– Scott - Слава Україні
Aug 31 '18 at 17:51
The command to do this is rn. From https://sevenzip.osdn.jp/chm/cmdline/commands/rename.htm:
7z rn <archive_name> <src_file_1> <dest_file_1> [ <src_file_2> <dest_file_2> ... ]