Clicky

I have the list of WinRar command line options, but I cannot determine from how those options are described which option(s) to use so that my new archive file contains the Relative Paths only and not the full path of the files.

While it may not be necessary, here are a couple of examples to clarify my question.
Files to be archived:
    C:\Temp\Folder1\*.*
    C:\Temp\Folder2\*.*
    C:\Temp\Folder3\*.*

In the GUI WinRar I would go to the 'parent' directory (for this example:  C:\Temp)  and just highlight the desired folders and then right-click to  Add To Archive...   and the results would be as desired.

The resultant ZIP file would contain the Relative folders only (no 'parent' directory info) and their associated files.

Now I want to do the same thing by using  WinRar Command Line Option flags instead of the GUI interface.

Your advice and/or suggestions will be greatly appreciated.

Thanks

asked 05/27/2011 02:24

jrbbldr's gravatar image

jrbbldr ♦♦


6 Answers:
Let me just add a couple more items for clarification....

First I am running the Winrar through  ShellExecute()

Secondly I am passing WinRar a List of Files to archive.  
And in that list of files I currently have fully specified the paths.
Example:
    C:\Temp\Folder1\*.*
    C:\Temp\Folder2\*.*
    C:\Temp\Folder3\*.*

Perhaps those file specifications should be something like to get what I want:
    ..\Folder1\*.*
    ..\Folder2\*.*
    ..\Folder3\*.*
I really don't know.

That added info may or may not have any bearing on the advice.

Thanks
 
link
jrbbldr's gravatar image

jrbbldr

Hi jrbbldr

May I suggest that you add your question to one more zone and make that one the primary zone:
OS > Microsoft OS > MS-DOS
(http://www.qa.downappz.com/OS/Microsoft_Operating_Systems/MS_DOS)

I don't have time to address your question at the moment, but I'm sure you will get more attention in the "DOS" zone than here.

Bill
link
BillDL's gravatar image

BillDL

Bill - thanks for the suggestion

But even though this question is regarding a command line which will execute under a DOS window, the question/issue itself is specific to WinRar and has no general bearing on DOS itself.  

I assume that those who might have the answers will most likely be somewhere within this Compression Tools forum.

Thanks
link
jrbbldr's gravatar image

jrbbldr

People who frequent the "DOS" zone are well used to stringing together commands from sometimes very complicated "usage" help files, hence the previous suggestion.  The "Compression Tools" zone doesn't get a whole lot of activity.

Are you calling WinRAR.exe or RAR.exe?
rar -?
Be aware that some options only apply if creating an RAR package and not for ZIP files.

These switches address how "paths" are handled by WinRAR/RAR from the command line.  Perhaps you can compare the results, or have you already tried them?

-ep   =  Files are added to an archive without including the path information.  Could result in multiple files existing in the archive with same name.

-ep1 = Do not store the path entered at the command line in archive.  Exclude base folder from names.

-ep2 = Expand paths to full.  Store full file paths (except drive letter and leading backslash) when archiving.
link
BillDL's gravatar image

BillDL

Thanks for the suggestions.

I am calling  WinRar.exe  in the command line.

Over the next few days I hope to get the chance to experiment with both:
   1.  the -ep1  option   (it sounds closest to what I need)
   2.  trying to use the shortened file path descriptors in the list of files (like mentioned above)

Hopefully I will hit on the right combination.

Thanks
link
jrbbldr's gravatar image

jrbbldr

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
link
Tolomir's gravatar image

Tolomir

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

Asked: 05/27/2011 02:24

Seen: 1963 times

Last updated: 07/05/2011 01:15