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

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
LonerD
Senior Member
Senior Member
Posts: 381
Joined: 2010-06-19, 20:18 UTC
Location: Makeyevka, Russia
Contact:

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

Post by *LonerD »

TC 11 beta5

Code: Select all

[em_PackFilesCurrentDir]
cmd=cm_PackFiles
param=T="%N.zip"
(or %B or %O instead %N).

Not the same as Ctrkl+Alt+F5, but something.
"I used to feel guilty in Cambridge that I spent all day playing games, while I was supposed to be doing mathematics. Then, when I discovered surreal numbers, I realized that playing games IS math." John Horton Conway
KozakMak
Senior Member
Senior Member
Posts: 359
Joined: 2021-05-24, 12:39 UTC
Location: UA

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

Post by *KozakMak »

KozakMak wrote: 2023-05-25, 06:12 UTC I want pack selected files\folders into current dir (in the same panel). Give me example how do that with parameters?
any changes for beta 5 ?
OS: Win10 | TC: latest x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48070
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) »

Yes, use the following on a button, in start menu, or for a hotkey:
Command: cm_PackFiles
Paramters: /T="%B0.ZIP"
This works except for the root of the drive, there it only creates an archive named .ZIP
Author of Total Commander
https://www.ghisler.com
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

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

Post by *sa16 »

ghisler(Author) wrote:or for a hotkey:
The parameter %B0 does not add a directory name here. Only on a button and in start menu.
Or am I wrong?
User avatar
Stefan2
Power Member
Power Member
Posts: 4153
Joined: 2007-09-13, 22:20 UTC
Location: Europa

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

Post by *Stefan2 »

sa16 wrote: 2023-06-02, 12:43 UTC
ghisler(Author) wrote:or for a hotkey:
The parameter %B0 does not add a directory name here. Only on a button and in start menu.
Or am I wrong?
Do you have created an own UserDefinedCommand in usercmd.ini for that?
To that em_command you can assigned a hotkey...





 
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

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

Post by *sa16 »

Stefan2 wrote:To that em_command you can assigned a hotkey...
Thank you! This method is known to me.
It's just that the Parameters: field has now appeared for hotkeys.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48070
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) »

The parameter %B0 does not add a directory name here.
It only adds a name of file. %B is the name of the parent directory, so if the parent directory is named "Parent", the suggested archive name will be "Parent.ZIP". When you don't specify a target directory, Total Commander will pack to the same directory.
Author of Total Commander
https://www.ghisler.com
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

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

Post by *sa16 »

2ghisler(Author)
Sorry! I'm talking about the fact that the parameter is not disclosed: zip:%B0.ZIP
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48070
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) »

%B0 is disclosed, it's a regular placeholder for the parameters field. Press F1 in the button bar change dialog:
%B, %B0..%B9
adds a directory name from the path (including the relative path from branch view, or the search result).
%B or %B0 = parent directory, %B1 = grandparent directory etc.
Author of Total Commander
https://www.ghisler.com
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

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

Post by *sa16 »

Folder C:\Test. Result with button Test.ZIP, with hotkey %B0.ZIP.
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post by *petermad »

2ghisler(Author)
This is about %B not working in Hotkey shortcut parameter:

In a button or em_command this works fine:

Code: Select all

cmd=cm_PackFiles
Param=/T="%B0.ZIP"
But in a Hotkey shortcut

Code: Select all

[Shortcuts]
C+W=cm_Packfiles
C+W_params=/T="%B.ZIP"
it does not work - - here %B is literally inserted in the path.
Same thing for cm_UnpackFiles


This works though:

Code: Select all

[Shortcuts]
C+W=ZIPFROMLIST
C+W_params=-o %B.ZIP %WF
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
sa16
Senior Member
Senior Member
Posts: 217
Joined: 2021-09-10, 07:15 UTC

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

Post by *sa16 »

History.txt wrote:04.06.23 Fixed: Internal commands like cm_PackFiles didn't expand parameters like %N in hotkeys (32/64)
Confirmed fixed in TC 11.00b6. Thanks!
User avatar
petermad
Power Member
Power Member
Posts: 14787
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

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

Post by *petermad »

I can also confirm this fixed in TC 11.00b6 :-)
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.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48070
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 also try the new function to use commands with parameters in the command line (above the buttons F5, F6 etc.).
Author of Total Commander
https://www.ghisler.com
Post Reply