How to make TC to pack a file into the same directory?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Soom
Junior Member
Junior Member
Posts: 3
Joined: 2020-02-03, 18:59 UTC

How to make TC to pack a file into the same directory?

Post by *Soom »

When I use the Pack command, it always shows me c:\ as the default location.
I cannot find a way to compress a file into it's own location without typing in the full path in the compression dialogue window each time.
Am I missing something?
Soom
Junior Member
Junior Member
Posts: 3
Joined: 2020-02-03, 18:59 UTC

Re: How to make TC to pack a file into the same directory?

Post by *Soom »

UPD: Ok, I found that if I just delete the c:\ before the filename, it will save it into the same directory. So the question is more - how to make this a default?
User avatar
tuska
Power Member
Power Member
Posts: 3760
Joined: 2007-05-21, 12:17 UTC

Re: How to make TC to pack a file into the same directory?

Post by *tuska »

Soom wrote: 2020-03-25, 15:55 UTC I cannot find a way to compress a file into it's own location without typing in the full path in the compression dialogue window each time.
Press the CTRL key and hold it down, then click on the button with command: cm_PackFiles
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to make TC to pack a file into the same directory?

Post by *Stefan2 »

How to pack to an archive into the same directory / panel?

Hold the CTRL key
while clicking at menu "Files > Pack..."
-or- together with F5
EDIT: oops :oops: please see correction by petermad in post below.




HTH? :D
User avatar
petermad
Power Member
Power Member
Posts: 14806
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: How to make TC to pack a file into the same directory?

Post by *petermad »

2Stefan2
-or- together with F5
It is actually together with Alt+F5 so all together it is Ctrl+Alt+F5 - and you have to put this in the [Shortcuts] section of your wincmd.ini

Code: Select all

CA+F5=cm_PackFiles

If you also put this in the [Shortcuts] section:

Code: Select all

CAS+F5=cm_PackFiles
then pressing Ctrl+Alt+Shift+F5 will move files to an archive in the current panel.


Alt+Shift+F5 always moves file to the archive - but in the opposite panel.

Ctrl+F5 sorts by date/time.
Last edited by petermad on 2020-03-26, 00:55 UTC, edited 1 time in total.
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
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to make TC to pack a file into the same directory?

Post by *Stefan2 »

petermad wrote: 2020-03-25, 17:13 UTC 2Stefan2

>>It is actually Ctrl+Alt+F5
Oh, yes right, I meant to write "-or- together with ALT+f5".

>> [Shortcuts] for CAS+F5
Ah, I see. The menu item works with CTRL without that wincmd.ini entry, but that INI entry is need to make the keyboard shortcut actually work.


Thanks for the corrections.

And good you also mentioned the other options too to have everything together.




 
User avatar
vort3
Junior Member
Junior Member
Posts: 20
Joined: 2020-04-11, 10:30 UTC
Location: Kazakhstan

Re: How to make TC to pack a file into the same directory?

Post by *vort3 »

I wish that instead of having to memorize all combinations of ctrl/shift/alt with F5/F6 (that are not really consistent, shift allows to stay in the same panel for F5/F6, but this doesn't always work for other combinations because they are already mapped to other functions by default) we just had a checkbox in copy/move dialog that could be marked with a hotkey.

For example, F5 is Copy to other panel, and Shift+F5 is Copy to the same panel. If you add Alt to F5, it's Pack to other panel. You would expect that Shift+Alt+F5 is Pack to the same panel, but nope, it's Pack to other panel (but also Move to archive). It's counter intuitive when you could have Shift+Alt+F5 to Pack to the same panel and if you also want to Move to archive, there is a Move to archive checkbox that you can mark by pressing Alt+o (because o is underlined and this is consistent throughout the whole program).

But now it's too late to change this behaviour, so at least we could have a checkbox like «In the same directory» (note underlined I, so we can just press Alt+I to pack within same panel without mouse).

I really hope some day we'll have it. I'm a new user of TC, I'm just trying to learn all of it's functions and get used to it, but those counter intuitive inconsistencies make it really hard to remember all needed hotkeys. And I'd really like to do all frequently used operations by keyboard, the less you use your mouse, the better.

English is not my native language.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: How to make TC to pack a file into the same directory?

Post by *ghisler(Author) »

Please hold down the Ctrl key while choosing menu Files - Pack.

You can assign a hotkey with Ctrl to cm_PackFiles to get this option, e.g. Ctrl+Alt+F5:
Configuration - Options - Misc. -> choose hotkey -> click magnifying glass -> pick cm_PackFiles -> OK
Author of Total Commander
https://www.ghisler.com
User avatar
vort3
Junior Member
Junior Member
Posts: 20
Joined: 2020-04-11, 10:30 UTC
Location: Kazakhstan

Re: How to make TC to pack a file into the same directory?

Post by *vort3 »

Well, after reading the manual more carefully I just realized that if you remove the packing/unpacking path, TC will assume the current path. So pretty much Alt+F9, Backspace will unpack files to current directory. Knowing this, I don't really need any buttons to do operations in the same panel.

English is not my native language.
User avatar
jinsight
Senior Member
Senior Member
Posts: 299
Joined: 2003-02-25, 19:47 UTC
Location: Wooster, Ohio, USA

Re: How to make TC to pack a file into the same directory?

Post by *jinsight »

2ghisler (Author) and/or
2petermad

I have assigned a hotkey with Ctrl to cm_PackFiles as discussed by Ghisler above in order to pack selected files in a current zip into a 7z file in the same folder. How can I make this into a button? Thanks.
License #1945
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
User avatar
nsp
Power Member
Power Member
Posts: 1805
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: How to make TC to pack a file into the same directory?

Post by *nsp »

The "in place" is selected if the key ctrl is down, we only have a single command for both actions.

From a button, you need to use either autohotkey or powerpro or.... to simulate ctrl key when calling cm_PackFiles.


The easiest is to use nircmd and create a user commands: in usercmd.ini file.
You can use a text editor to add the following commands or edit one by one using command browser : cm_CommandBrowser

Code: Select all

[em_ctrldown]
button=
cmd=nircmd
param=sendkey ctrl down

[em_ctrlup]
button=
cmd=nircmd
param=sendkey ctrl up

[em_packInPlace]
button=WCMICONS.DLL,30
cmd=em_ctrldown,cm_wait 1,cm_PackFiles,em_ctrlup
menu=Pack in place
Once done, you can assign em_packInPlace to any button !
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: How to make TC to pack a file into the same directory?

Post by *Stefan2 »

2nsp

or perhaps like this?

Step 1)
wincmd.ini
[Shortcuts]
CA+F5=cm_PackFiles ; Ctrl+Alt+F5 = pack to an archive into the same directory

Step 2)
nircmd sendkey Ctrl+Alt+F5



 ?
User avatar
nsp
Power Member
Power Member
Posts: 1805
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: How to make TC to pack a file into the same directory?

Post by *nsp »

I do not use nircmd to send full shortcut with modifier (shift/ctrl) to TC as it needs wait to get captured. I'm pretty sure that it does not work ! PowerPro,AHK,AutoIt.. are beter for this task.
Stefan2 wrote: 2021-12-14, 10:01 UTC 2nsp

or perhaps like this?

Step 1)
wincmd.ini
[Shortcuts]
CA+F5=cm_PackFiles ; Ctrl+Alt+F5 = pack to an archive into the same directory

Step 2)
nircmd sendkey Ctrl+Alt+F5



?
I do not use nircmd sendkey to send full shortcut with modifier (shift/ctrl) to TC as it needs small wait to get captured.
I'm pretty sure that it does not work in a single command ! PowerPro,AHK,AutoIt.. are beter for this task.
User avatar
jinsight
Senior Member
Senior Member
Posts: 299
Joined: 2003-02-25, 19:47 UTC
Location: Wooster, Ohio, USA

Re: How to make TC to pack a file into the same directory?

Post by *jinsight »

2Stefan2

Thank you so much!

With a littler fine tuning I was able to pack selected files within an existing zip file into a new 7z file in the same folder.

Step 1 let you use Ctrl+F5 to do this rather than Ctrl+Alt+Shft+F5 or Ctrl+ a button that packs files.

Step 2 creates a button out of Step 1 using nircmd v2.86, https://www.nirsoft.net/utils/nircmd.html. There is a 32 bit version. In the button point to your location for nircmd or copy it to the windows directory to use it without a path.

Step 1 - Create a hot key
wincmd.ini
[Shortcuts]
CA+F5=cm_PackFiles ; Ctrl+Alt+F5 = pack to an archive into the same directory

Step 2 - Create a button out of the hotkey. Copy from TOTAL through -1 and past it into a button bar.
TOTALCMD#BAR#DATA
F:\TC_64\Addons\Nircmd_64\nircmd.exe
sendkeypress Ctrl+F5
wcmicons.dll,30
Pack selected files within archive with name of file under cursor in same folder


-1
License #1945
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
Post Reply