go a relative root directory

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
slymz
Junior Member
Junior Member
Posts: 8
Joined: 2013-12-13, 19:04 UTC

go a relative root directory

Post by *slymz »

It so happens that I work in directories of the form

c:\prefix\work1\[a\b\ ...]
c:\prefix\work2\[d\e\f ...]
c:\prefix\work3\[g\h\i\j\k ...]

and so on.

I was wondering if it is possible to assign a Directory Hotlist shortcut (ctrl+D) (or any other shortcut for that matter) that would take me to, e.g, 'c:/prefix/work1' whenever the pane is under some (unspecified levels deep) subdirectory of 'c:/prefix/work1'?
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Try to create a button or user-command with (don't forget last backslash after prefix):

Code: Select all

Command: go_to_prefixed_root.cmd
Parameters: "c:\prefix\" "%P"
Run minimized: Yes
Where go_to_prefixed_root.cmd:

Code: Select all

@echo off
if -%1==- echo Params: ^<prefix\^> "%%P" & pause & goto :EOF
for /d %%d in ("%~dp1*") do (
	echo "%~dp2" | find /i "%%d" >nul
	if not errorlevel 1 (
		start "" "%COMMANDER_EXE%" /O /S /L="%%d"
		goto :EOF
	)
)
Batch file tries to find paths of all subdirs of your prefix dir (c:\prefix\work1\, c:\prefix\work2\ etc) in the path and opens matched dir in TC.

You can use user-command name (em_..., may be created from buttonbar button choose command dialog in usercmd.ini section) in Ctrl+D entry.
You can also use go_to_prefixed_root.cmd c:\prefix\ "%P" there but it will show black window.
User avatar
ado
Senior Member
Senior Member
Posts: 445
Joined: 2003-02-18, 13:22 UTC
Location: Slovakia, Pezinok

Post by *ado »

not sure if this is what you want, but there is "Start" menu in TC that you can customize where you can assign to each your entry Keyboard shortcut (up to 24 shortcuts).
So you can define entry in that menu with command "cd c:\prefix\work1" and assign shortcut to it. The problem is that set of shortcuts is quite limited - only Ctrl-Alt-F_key and Ctrl-Alt-Shift-F_key
User avatar
ado
Senior Member
Senior Member
Posts: 445
Joined: 2003-02-18, 13:22 UTC
Location: Slovakia, Pezinok

Post by *ado »

ado wrote:The problem is that set of shortcuts is quite limited - only Ctrl-Alt-F_key and Ctrl-Alt-Shift-F_key
actually you are not limited... you can define any shortcut in Configuration->Misc to these menu items: cm_UserMenu1...
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

ado,
BTW you can create any number of user-commands like em_mycmd1, em_mycmd2 etc and assign shortcuts to them, you're not limited to Start menu items (there is a special section usercmd.ini for custom commands in command browser).
But slymz wants to use exactly one command / hotlist menu item / shortcut for such task.
Post Reply