Improvement for cd command to focus on archives

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Improvement for cd command to focus on archives

Post by *DrShark »

It's a known and intentional limitation of Total Commander's internal cd command is that it always tries to open archive passed to it.

A kind of workaround (found here) is to create a button:

Code: Select all

TOTALCMD#BAR#DATA
cd
?\:
%COMMANDER_EXE%,1



-1
and after clicking it to paste a path (without environment variables!) to archive before ":\". This way of focusing on archive with cd command doesn't work when used from Total Commander's command line.

It would be nice to have some way to tell to cd command to focus archive instead of trying to open it, maybe by making above workaround working in Total Commander's command line, and with proper support of environment variables.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
dindog
Senior Member
Senior Member
Posts: 315
Joined: 2010-10-18, 07:41 UTC

Re: Improvement for cd command to focus on archives

Post by *dindog »

there is a A flag for not openning archive , like S for "source"
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: Improvement for cd command to focus on archives

Post by *Fla$her »

Since I am the author of the idea, I can say with confidence that this trick works perfectly from the command line, what I wrote about in the
article at the time.
Overquoting is evil! 👎
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Improvement for cd command to focus on archives

Post by *DrShark »

dindog wrote: 2020-01-20, 21:57 UTC there is a A flag for not openning archive , like S for "source"
yes, it's for %COMMANDER_EXE%, typing which with needed flags and path is way longer than typing cd <path>
Fla$her wrote: 2020-01-20, 22:57 UTCSince I am the author of the idea, I can say with confidence that this trick works perfectly from the command line
I have this in [PackerPlugins]:

Code: Select all

pe_res_dummy=223,c:\backup_c\Program Files\totalcmd\Archivers\wcx_resextract_1.1.1c\ResExtract.wcx
so when I execute from command line:
cd c:\totalcmd\TOTALCMD.exe
TC opens TOTALCMD.exe as archive using ResExtract.wcx.

If I try from command line:
cd c:\totalcmd\TOTALCMD.exe\:
or
cd "c:\totalcmd\TOTALCMD.exe\:"
Total Commander doesn't change current directory.

If I try from command line:
cd c:\totalcmd\TOTALCMD.exe:
or
cd "c:\totalcmd\TOTALCMD.exe:"
TC opens c:\totalcmd\ but focus goes on [..] item.

Edit:
tckb.ru wrote:Для того, чтобы была возможность и из командной строки осуществлять описанный переход по cd, необходимо на странице Разное создать псевдоним "cd" для аналогичной команды в usercmd.ini.
So basically to make it work in command line the article suggests to create for cd command an alias with the same name which will execute a user command with internal cd as a command. Then it won't be a pure internal cd anymore.
Last edited by DrShark on 2020-01-21, 11:30 UTC, edited 1 time in total.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
Fla$her
Power Member
Power Member
Posts: 2299
Joined: 2020-01-18, 04:03 UTC

Re: Improvement for cd command to focus on archives

Post by *Fla$her »

2DrShark
Yes, that's right. Need to create a alias 'cd' for em_cd:
Command: cd
Parameters: %Z%A
P.S.: But aliases act only from command line, so you don't really lose anything.
Overquoting is evil! 👎
Post Reply