Advanced directory change (using CD or something else)

Here you can propose new features, make suggestions etc.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
sssf
Junior Member
Junior Member
Posts: 6
Joined: 2008-03-14, 14:17 UTC

Advanced directory change (using CD or something else)

Post by *sssf »

I am a programmer myself and I always have different versions of the same repository on my hard drive.
These repositories end up on my hard drive like this:
c:\CT\CAM1\...
c:\CT\CAM2\...
c:\CT\CAM3\...

All repositories have 99% of the time the same sub directory structure and often I find myself somewhere deep in a repository, ie:
c:\CT\CAM1\hardware\driver\pic\model\ (actually way deeper normally, but this is just as an example)
Now I need to go to the same position but in a different repository (or want it opened in a different TAB), I want to go for instance here:
c:\CT\CAM2\hardware\driver\pic\model\

Currently I need to go there traversing the whole path manually, or copy the path and change the CAM1 into CAM2 before using the command line and adding CD in front of it.

I would love to have a button (actually several; one for every repository) that can automate this.
So when I press my button called CAM2, I would jump to the same position (regarding the sub directories) in repository CAM2 from where I am currently positioned.

I already searched the forum but nothing comes close to what I want.

To get this working I need to chop the current directory into several parts:
part1: Base of my repository (in my example: c:\CT\CAM1\ )
part2: Remaining part of the current directory (in my example: hardware\driver\pic\model\ )

I can think about different ways how to get this functionality working
1) Have total commander support it internally (this is probably way to specific to justify making this)
2) Be able to do a regex search and replace in button bar parameters %P, %T so that the current CD command can be used (would be very cool and give enormous amount of flexibility so that it can be used also in other ways)
3) Writing a plugin that is able to change the current directory (I never wrote a plugin, and I also do not know if a plugin is able to change the current directory)
4) Any ideas from you as a reader :)
DO OR DIE
User avatar
white
Power Member
Power Member
Posts: 5988
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Advanced directory change (using CD or something else)

Post by *white »

sssf wrote:These repositories end up on my hard drive like this:
c:\CT\CAM1\...
c:\CT\CAM2\...
c:\CT\CAM3\...

...

I would love to have a button (actually several; one for every repository) that can automate this.
So when I press my button called CAM2, I would jump to the same position (regarding the sub directories) in repository CAM2 from where I am currently positioned.

Code: Select all

%comspec% /c start "" "%commander_exe%" /O /S /L="%CD:~0,9%2%CD:~10%"
Post Reply