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:
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.
asked 05/27/2011 06:24
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.
Perhaps those file specifications should be something like to get what I want:
I really don't know.
That added info may or may not have any bearing on the advice.
May I suggest that you add your question to one more zone and make that one the primary zone:
OS > Microsoft OS > 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 - 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.
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?
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.
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.
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.