Page 1 of 1
toolbar button for WinRAR
Posted: 23 Oct 2009 20:55
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
Re: toolbar button for WinRAR
Posted: 23 Oct 2009 23:26
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

Re: toolbar button for WinRAR
Posted: 24 Oct 2009 00:26
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

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.
Re: toolbar button for WinRAR
Posted: 24 Oct 2009 00:35
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

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.
Re: toolbar button for WinRAR
Posted: 24 Oct 2009 07:57
by paul0
TheQwerty wrote:zer0 wrote:... I believe '-ep1' works a bit better and is probably the one paul's after.
Thanks, TheQwerty:-)
this command works perfectly.
openwith """C:\WinRAR\winRAR.exe"" a -r -ep1 <curfolder>-<date yyyymmdd> <items>", s
Thanks again.
Re: toolbar button for WinRAR
Posted: 24 Oct 2009 16:23
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.