[b4] How to cm_PackFiles into current dir with parameters?

English support forum

Moderators: white, Hacker, petermad, Stefan2

KozakMak
Senior Member
Senior Member
Posts: 352
Joined: 2021-05-24, 12:39 UTC
Location: UA

[b4] How to cm_PackFiles into current dir with parameters?

Post by *KozakMak »

I want pack selected files\folders into current dir (in the same panel). Give me example how do that with parameters?
OS: Win10 | TC: latest x64
avatar70t
Junior Member
Junior Member
Posts: 5
Joined: 2013-11-15, 04:08 UTC

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *avatar70t »

cm_PackFiles /M1T="1.zip"
but i dont't know how to set zip name to current dir name
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *Horst.Epp »

avatar70t wrote: 2023-05-25, 09:14 UTC cm_PackFiles /M1T="1.zip"
but i dont't know how to set zip name to current dir name
This way
cm_PackFiles /M1T="%B.zip"
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *petermad »

cm_PackFiles /M1T="%B.zip"
Doesn't work - you cannot use %B in the Command field, and currently the parameters doesn't work in the Parameters field (hopefully that will be fixed)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *Horst.Epp »

petermad wrote: 2023-05-25, 11:55 UTC
cm_PackFiles /M1T="%B.zip"
Doesn't work - you cannot use %B in the Command field, and currently the parameters doesn't work in the Parameters field (hopefully that will be fixed)
For testing I made a button using the parameter field.
This works here, I only have to press ok.
The archive is created in the target with the name of the source folder.

Code: Select all

TOTALCMD#BAR#DATA
cm_PackFiles
/M1T="%B.zip"
C:\Tools\Wincmd\TOTALCMD.EXE,5



-1
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *Fla$her »

2Horst.Epp
The name of the parent folder is substituted by default, so you think %B works, but it doesn't. See p. 4.
Clear the parameters field and get the same result when selecting multiple files/folders.
Overquoting is evil! 👎
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *Horst.Epp »

2Fla$her
You are right, thanks for the clarification.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *petermad »

Horst.Epp wrote:The archive is created in the target with the name of the source folder.
The name is by deafult set to the parent folder when multiple files are selected as Fla$her also points out, and the task was to pack in the source panel (same panel):
KozakMak wrote:I want pack selected files\folders into current dir (in the same panel)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *petermad »

2KozakMak
You can use the ZIPFROMLIST command for this:

Code: Select all

[em_zipfromlist1]
cmd=ZIPFROMLIST -o
param="%O.zip" %UF
menu=Pack selected elements to archive with name of file under cursor - in same folder
button=wcmicons.dll,30
or:

Code: Select all

[em_zipfromlist2]
cmd=ZIPFROMLIST -o
param="%B.zip" %UF
menu=Pack selected elements to archive with name of current dir - in same folder
button=wcmicons.dll,30
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
rus73
Junior Member
Junior Member
Posts: 29
Joined: 2013-05-30, 08:39 UTC
Location: Russia

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *rus73 »

Working version with cm_PackFiles:

Code: Select all

[em_PackFiles1]
cmd=cm_PackFiles /D1R1A0E="rar"
param=T="%O"
menu=Pack selected elements to RAR-archive with name of file under cursor in same folder
button=wcmicons.dll,30

Code: Select all

[em_PackFiles2]
cmd=cm_PackFiles /D1R1A0E="rar"
param=T="%B"
menu=Pack selected elements to rar-archive with name of current dir in same folder
button=wcmicons.dll,30
sa16
Senior Member
Senior Member
Posts: 215
Joined: 2021-09-10, 07:15 UTC

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *sa16 »

For assortment, button:

Code: Select all

TOTALCMD#BAR#DATA
cm_MatchSrc,cm_PackFiles /G,cm_FocusTrg,cm_GotoPreviousDir,cm_FocusTrg

WCMICONS.DLL,30
Pack in same folder
KozakMak
Senior Member
Senior Member
Posts: 352
Joined: 2021-05-24, 12:39 UTC
Location: UA

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *KozakMak »

hm... it looks complicated, I would like without such quests :lol:
OS: Win10 | TC: latest x64
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *petermad »

rus73 wrote: 2023-05-26, 03:18 UTC Working version with cm_PackFiles:

Code: Select all

[em_PackFiles1]
cmd=cm_PackFiles /D1R1A0E="rar"
param=T="%O"
menu=Pack selected elements to RAR-archive with name of file under cursor in same folder
button=wcmicons.dll,30

Code: Select all

[em_PackFiles2]
cmd=cm_PackFiles /D1R1A0E="rar"
param=T="%B"
menu=Pack selected elements to rar-archive with name of current dir in same folder
button=wcmicons.dll,30
Works with rar, but if I replace rar with zip the archives are made without extension.

But these works with zip too:

Code: Select all

[em_PackFiles1]
cmd=cm_PackFiles /D1R1A0E="zip"
param=T="%O.zip"
menu=Pack selected elements to ZIP-archive with name of file under cursor in same folder
button=wcmicons.dll,30

Code: Select all

[em_PackFiles2]
cmd=cm_PackFiles /D1R1A0E="zip"
param=T="%B.zip"
menu=Pack selected elements to ZIP-archive with name of current dir in same folder
button=wcmicons.dll,30
[/quote]


Actually basically this works:

Code: Select all

[em_PackFiles3]
cmd=cm_PackFiles /
param=T="%O.zip"
menu=Pack selected elements to ZIP-archive with name of file under cursor in same folder
button=wcmicons.dll,30
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *ghisler(Author) »

Please wait for beta 5, then cm_packfiles will support options in the parameters field too.
Author of Total Commander
https://www.ghisler.com
User avatar
rus73
Junior Member
Junior Member
Posts: 29
Joined: 2013-05-30, 08:39 UTC
Location: Russia

Re: [b4] How to cm_PackFiles into current dir with parameters?

Post by *rus73 »

Thank you. We are waiting for the final version.
Post Reply