Open folder in other pane with fix path-part + current path?

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
haibinpro
Junior Member
Junior Member
Posts: 66
Joined: 2005-10-21, 04:55 UTC
Location: china

Open folder in other pane with fix path-part + current path?

Post 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
______________________
#147708 Personal licence
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post 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?



 
haibinpro
Junior Member
Junior Member
Posts: 66
Joined: 2005-10-21, 04:55 UTC
Location: china

Post 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.
______________________
#147708 Personal licence
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post 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"



 
Last edited by Stefan2 on 2017-06-23, 18:12 UTC, edited 1 time in total.
haibinpro
Junior Member
Junior Member
Posts: 66
Joined: 2005-10-21, 04:55 UTC
Location: china

Post 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.
______________________
#147708 Personal licence
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post 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.
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

DOS-Batch: modify path and open in other panel

Post 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? :D


 
haibinpro
Junior Member
Junior Member
Posts: 66
Joined: 2005-10-21, 04:55 UTC
Location: china

Post 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%" 
______________________
#147708 Personal licence
User avatar
Stefan2
Power Member
Power Member
Posts: 4158
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Post by *Stefan2 »

Alright, thanks for the feedback. Greetings to China, where all my nice gadgets comes from.




 
Post Reply