0

I have read RAR a folder without persisting the full path which helps about the RAR -ep1 switch but I still have the following problem:

I want to add the directory D:\Temp\FolderA and its subdirectories/files to a RAR archive:

D:\Temp\FolderA\A1
D:\Temp\FolderA\B2
D:\Temp\FolderA\C3\D4\E5.txt

... but with a custom name in the archive instead of FolderA. Inside the RAR archive, it should look like this:

BaseFolder\SubDir\OtherName\A1
BaseFolder\SubDir\OtherName\B2
BaseFolder\SubDir\OtherName\C3\D4\E5.txt

I tried:

rar a -r test.rar D:\Temp\FolderA

but obviously the name FolderA appears in the RAR package, which I don't want.

How is it possible with RAR?

Note: If possible, I'd like to avoid to temporary rename D:\Temp\FolderA into D:\Temp\BaseFolder\SubDir\OtherName, and avoid to create temporary symlinks.

1 Answer 1

0

I found a solution in the meantime with the switch -ap"New path" combined with -ep1:

rar a -r test.rar -ep1 -ap"BaseFolder\SubDir\OtherName\" "D:\Temp\FolderA\*"

Indeed the RAR command-line manual states:

-ap    Set path inside archive. This path is *merged* to file names when
       adding  files to an archive [...]

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .