Page 1 of 1
Open folder in other pane with fix path-part + current path?
Posted: 2017-02-08, 06:24 UTC
by haibinpro
Sugguest TC have map function to jump to certain folder. (Subject line modified by Mod)
That is,
as an example,currently I am in dir "c:\Program Files\EverEdit 4.0\mode"
As I have been copy tree to some other dir,or use some software like sandbox.
So,I need to goto certain dir related to it,somewhat like "c:\Sandbox\Administrator\DefaultBox\drive\C\Program Files\EverEdit 4.0\mode"
and it can do so.
currently,I may use AHK or some copyenhance tools to do so.
but maybe it's a funny function to add to TC
best regards
Posted: 2017-02-08, 08:39 UTC
by Stefan2
You mean:
if I open folder A in one panel, the other panel should automatically open folder X?
And if I go to folder B, the other panel shows magically folder Z?
Posted: 2017-02-08, 10:07 UTC
by haibinpro
no exactaly.
the point is map,
I mean when I need, I can click some hotkey to jump to the relate dir.
the dir open in other panel is better.
Posted: 2017-02-08, 10:41 UTC
by Stefan2
I still don't get it.
Do you need to switch to related, dynamically from current folder build paths?
If in "c:\Program Files\EverEdit 4.0\mode"
switch to "c:\Sandbox\Administrator\DefaultBox\drive\c\Program Files\EverEdit 4.0\mode"
If in "c:\Work\ABC"
switch to "c:\Sandbox\Administrator\DefaultBox\drive\c\Work\ABC"
Posted: 2017-02-09, 05:35 UTC
by haibinpro
yes,You are right.
dynamically from current folder build paths
the prex may change too,
if I choose prex "c:\Sandbox\Administrator\DefaultBox\drive\",it will dynamically replace to the prex I choosed.
The prex can be change is better.
Posted: 2017-02-09, 07:06 UTC
by MVV
There is no generic way to know how many levels you need to skip and which folder should become new root, so you can only use external ways like mentioned AHK scripts.
And such script should get three parameters: source root (e.g. C:\ in your example), target root (e.g. c:\Sandbox\Administrator\DefaultBox\drive\C) and source path (e.g. c:\Program Files\EverEdit 4.0\mode), only with these three values we can get the fourth one, target path.
So you will need multiple buttons/commands for different pairs of roots.
DOS-Batch: modify path and open in other panel
Posted: 2017-02-09, 08:27 UTC
by Stefan2
I think that could be done by utilizing a script like that over there:
http://ghisler.ch/board/viewtopic.php?p=304419#304419
Here adopted / modified for your purpose:
... switch to related, dynamically from current folder build paths:
If in "
c:\Program Files\EverEdit 4.0\mode"
switch to "c:\Sandbox\Administrator\DefaultBox\drive\
c\Program Files\EverEdit 4.0\mode" in other panel.
Code: Select all
@ECHO OFF
REM Batch for Total Commander
REM Modify path and open in other panel
REM Build dynamically new path from fix prefix plus current folder.
REM Found at http://ghisler.ch/board/viewtopic.php?p=324995#324995
REM
REM Stefan, 2017-02-09
REM Usage:
REM Create a TC button
REM CMD: path\to\this\SyncPath.cmd
REM PARAM: "%P"
SET "FixPrefix=c:\Sandbox\Administrator\DefaultBox\drive\"
ECHO FixPrefix: %FixPrefix%
REM CurrPath from TCs "%P" parameter:
SET "CurrPath=%~1"
ECHO CurrPath : %CurrPath%
SET "CurrPath=%CurrPath::=%"
ECHO CurrPath : %CurrPath%
SET "TARGET=%FixPrefix%%CurrPath%"
ECHO TARGET : %TARGET%
ECHO GO: Open new path in other (target) panel:
ECHO "%Commander_Exe%" /O /S /R="%TARGET%"
rem "%Commander_Exe%" /O /S /R="%TARGET%"
PAUSE
GoTo :EOF
R E S U L T ..... DOS-Box shows:
FixPrefix: c:\Sandbox\Administrator\DefaultBox\drive\
CurrPath : C:\Temp\ToCmd\Test\
CurrPath : C\Temp\ToCmd\Test\
TARGET : c:\Sandbox\Administrator\DefaultBox\drive\C\Temp\ToCmd\Test\
GO: Open new path in other (target) panel:
"X:\Tools\ToCo\TOTALCMD.EXE" /O /S /R="c:\Sandbox\Administrator\DefaultBox\drive\C\Temp\ToCmd\Test\"
Drücken Sie eine beliebige Taste . . .
HTH?
Posted: 2017-02-10, 05:47 UTC
by haibinpro
Thanks,It is examctaly what I need.
I edit the batch files
change
'''
ECHO GO: Open new path in other (target) panel:
ECHO "%Commander_Exe%" /O /S /R="%TARGET%"
'''
to
'''
ECHO GO: Open new path in other (target) panel:
"%Commander_Exe%" /O /S /R="%TARGET%"
'''
and it works.
Thanks very much.you are so kind.
Code: Select all
@ECHO OFF
REM Batch for Total Commander
REM Modify path and open in other panel
REM Build dynamically new path from fix prefix plus current folder.
REM Found at http://ghisler.ch/board/viewtopic.php?p=324995#324995
REM
REM Stefan, 2017-02-09
REM Usage:
REM Create a TC button
REM CMD: path\to\this\SyncPath.cmd
REM PARAM: "%P"
SET "FixPrefix=c:\Sandbox\Administrator\DefaultBox\drive\"
ECHO FixPrefix: %FixPrefix%
REM CurrPath from TCs "%P" parameter:
SET "CurrPath=%~1"
ECHO CurrPath : %CurrPath%
SET "CurrPath=%CurrPath::=%"
ECHO CurrPath : %CurrPath%
SET "TARGET=%FixPrefix%%CurrPath%"
ECHO TARGET : %TARGET%
ECHO GO: Open new path in other (target) panel:
"%Commander_Exe%" /O /S /R="%TARGET%"
rem "%Commander_Exe%" /O /S /R="%TARGET%"
Posted: 2017-02-10, 08:04 UTC
by Stefan2
Alright, thanks for the feedback. Greetings to China, where all my nice gadgets comes from.