Help with TC button parameter for WINRAR

English support forum

Moderators: Hacker, petermad, Stefan2, white

leo007
Junior Member
Junior Member
Posts: 42
Joined: 2019-10-28, 08:09 UTC

Re: Help with TC button parameter for WINRAR

Post by *leo007 »

both parameter codes suggested
by Horst.Epp

Code: Select all

TOTALCMD#BAR#DATA
"C:\Program Files\WinRAR\winRar.exe"
a -ep1 -os -m5 -tl -ag"_YYYYMMDDHHMMSS" "%P\%B".rar %S
Wcmicons.dll,30
(WinRAR) Pack Here


-1
and by petermad

Code: Select all

TOTALCMD#BAR#DATA
"C:\Program Files\WinRAR\winRar.exe"
a %P%O.rar @%WF
wcmicons.dll,30
Add selected files to RAR archive with name as file under cursor


-1
both work perfectly well. Many thanks for all the help :)
My mistake was also including Start path: "C:\Program Files\WinRAR\" and this seems to result in the attached errors.
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Help with TC button parameter for WINRAR

Post by *Horst.Epp »

I simplified my button a little bit, now it looks like this:

Code: Select all

TOTALCMD#BAR#DATA
"C:\Program Files\WinRAR\winRar.exe"
a -ep1 -os -m5 "%P%B".rar %S
C:\Program Files\WinRAR\WinRAR.exe
Pack selected as RAR


-1
Petermad's suggestion doesn't include nested sub-dirs when I select one dir
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Help with TC button parameter for WINRAR

Post by *petermad »

Petermad's suggestion doesn't include nested sub-dirs when I select one dir
That should be fixed in this version:

Code: Select all

TOTALCMD#BAR#DATA
%COMMANDER_PATH%\PACKERS\RAR\WinRAR.exe
a -r "%P%O.rar" @%WF
wcmicons.dll,30
Add selected files to RAR archive with name as file under cursor


-1
Also corrected that the previous button did not work if there were spaces in the path to the rar file.

The benefit of using @%WF instead of %S is that there is a limit of 32767 characters to the length of the command line when using %S, so adding many files with long names could potentially be a problem.

BTW, I don't think -ep1 is necessary in Horst.Epp's button as long as %S is used - it is only necessary if %P%S is used.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Help with TC button parameter for WINRAR

Post by *Horst.Epp »

2Petermad
Ok, this version is ok.
I like to have the archive name according to the source dir and stored into the target.

I now changed my version to the following button.

Code: Select all

TOTALCMD#BAR#DATA
"C:\Program Files\WinRAR\winRar.exe"
a -r "%T%B.rar" @%WF
C:\Program Files\WinRAR\WinRAR.exe
Pack selected as RAR into target


-1
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
User avatar
petermad
Power Member
Power Member
Posts: 16001
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Help with TC button parameter for WINRAR

Post by *petermad »

2Horst.Epp

It can still be good to keep -m5 if you want maximum compression.
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6951
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Help with TC button parameter for WINRAR

Post by *Horst.Epp »

petermad wrote: 2024-11-10, 10:58 UTC 2Horst.Epp

It can still be good to keep -m5 if you want maximum compression.
The default WinRAR compression is Best.
Nevertheless, I'll add -m5 to my button.
Thanks
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Post Reply