toolbar button for WinRAR

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
paul0
Posts: 137
Joined: 23 Oct 2009 19:26

toolbar button for WinRAR

Post by paul0 »

I want to compress selected files to a rar file:

the command for the button is like below

run "C:\WinRAR\winRAR.exe" "a" "<curfolder>-<date yyyymmdd>" "<items>", "<curpath>", s

It successfully compress file into a rar file <curfolder>-<date yyyymmdd>.rar

however, the each file in the rar has the full path. I just want to have relative path.

P.s. I posted a wish here.
http://www.xyplorer.com/xyfc/viewtopic.php?f=5&t=4227

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: toolbar button for WinRAR

Post by zer0 »

That question has nothing to do with XYplorer, it's to do with WinRAR and its command line switches.

I don't think there's a command line switch to only have relative paths, but there's a switch to exclude paths and that switch is "-ep". Of course the danger is that you may get two files with the same name. If that's not good enough, then you can archive them manually :roll:
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

paul0
Posts: 137
Joined: 23 Oct 2009 19:26

Re: toolbar button for WinRAR

Post by paul0 »

zer0 wrote:I don't think there's a command line switch to only have relative paths, but there's a switch to exclude paths and that switch is "-ep". Of course the danger is that you may get two files with the same name. If that's not good enough, then you can archive them manually :roll:
thanks. the above way will also make the structure flat as well.

Archive the relative path such that we can extra those files to some other place but keep the relative path.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: toolbar button for WinRAR

Post by TheQwerty »

zer0 wrote:but there's a switch to exclude paths and that switch is "-ep". Of course the danger is that you may get two files with the same name. If that's not good enough, then you can archive them manually :roll:
I think there's like 4 different versions of '-ep'. I believe '-ep1' works a bit better and is probably the one paul's after.

paul0
Posts: 137
Joined: 23 Oct 2009 19:26

Re: toolbar button for WinRAR

Post by paul0 »

TheQwerty wrote:
zer0 wrote:... I believe '-ep1' works a bit better and is probably the one paul's after.
Thanks, TheQwerty:-) :D

this command works perfectly.
openwith """C:\WinRAR\winRAR.exe"" a -r -ep1 <curfolder>-<date yyyymmdd> <items>", s

Thanks again.

paul0
Posts: 137
Joined: 23 Oct 2009 19:26

Re: toolbar button for WinRAR

Post by paul0 »

here is a minor update of the command.

openwith """C:\WinRAR\winRAR.exe"" a -r -ep1 ""<curfolder>-<date yyyymmdd>"" <items>", s

I add double quotes into command in case the <curfolder> has some sapces in between.

Post Reply