Page 1 of 1

Improvement for cd command to focus on archives

Posted: 2020-01-20, 17:49 UTC
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.

Re: Improvement for cd command to focus on archives

Posted: 2020-01-20, 21:57 UTC
by dindog
there is a A flag for not openning archive , like S for "source"

Re: Improvement for cd command to focus on archives

Posted: 2020-01-20, 22:57 UTC
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.

Re: Improvement for cd command to focus on archives

Posted: 2020-01-20, 23:36 UTC
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.

Re: Improvement for cd command to focus on archives

Posted: 2020-01-20, 23:57 UTC
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.