Command to open a directory in a new tab

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Command to open a directory in a new tab

Post by *sidefx88 »

Hi!

I set a lot of key shortcuts to go directly to certain directories I frequently use. Now I'm asking if there's a command (or way) to set some new key shortcuts to go to those directories but in a new tab.

Thanks in advance!

Cheers
I Love Total Commander!
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

RTFM:
TC help, 'Command line parameters' page wrote:/T Opens the passed dir(s) in new tab(s)
Single user license #329241
PowerPro scripts for Total Commander
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Post by *sidefx88 »

Thanks for answering, but I don't get it.

One of my original commands assigned to a keyboard shortcut is:

[usercmd.ini]

[em_usercmd5]
button=
cmd=cd e:\Music


Where I must add the "/T" param.
I tried to add a new line "param=/T", but it didn't work.
I Love Total Commander!
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Post by *sidefx88 »

2Vochomurka:

I guess that your suggestion only works to open Total Commander and automatically open tabs in specified dirs.

But I need to open tabs in specified dirs when TC is already running :(
I Love Total Commander!
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Post by *sidefx88 »

I do know how to add short-cut, which open directory in active tab (cd c:\MyDirectory),

I do know how to add short-cut, which create new tab in active window (cm_opennewtab)

But I do not know how to add shortcut which merge above two in one, so I can open desired directory in new tab. Any ideas?
I Love Total Commander!
User avatar
Vochomurka
Power Member
Power Member
Posts: 816
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

Please execute the following command (after replacing my path with yours):

Code: Select all

%COMMANDER_EXE% /L=c:\your\path /O /T
This command can be executed from command line, hotkey, bar button, alias, etc.
And read the "Command line parameters" chapter carefully!
Single user license #329241
PowerPro scripts for Total Commander
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Post by *sidefx88 »

It works but not in the active panel :(

Only works in the left (or right, /L - /R) :(


I was trying using the command "appentabs file1.tab", it works on the active panel, but opens the new tab "in background", not as the active tab :(
I Love Total Commander!
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Post by *sidefx88 »

Finally it works by adding the /S parameter!

%COMMANDER_EXE% "c:\your\path" /O /T /S

Thanks, mate! :)
I Love Total Commander!
User avatar
white
Power Member
Power Member
Posts: 6013
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

sidefx88 wrote:Thanks for answering, but I don't get it.

One of my original commands assigned to a keyboard shortcut is:

[usercmd.ini]

[em_usercmd5]
button=
cmd=cd e:\Music
sidefx88 wrote:I do know how to add short-cut, which open directory in active tab (cd c:\MyDirectory),

I do know how to add short-cut, which create new tab in active window (cm_opennewtab)

But I do not know how to add shortcut which merge above two in one, so I can open desired directory in new tab. Any ideas?
[usercmd.ini]

[em_cdMusic]
button=
cmd=cd e:\Music


[em_cdMusicNewTab]
button=
cmd=cm_opennewtab,em_cdMusic
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2white

Where is the documentation of this?
User avatar
white
Power Member
Power Member
Posts: 6013
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Post by *white »

ts4242 wrote:2white

Where is the documentation of this?
When defining a new user command click the Help button. You will see:
Help wrote:Command: There are many possible commands which can be placed in this field:
1. ...
2. You can also place one or more of Total Commander's internal menu commands here comma-separated. Just click on the button with the magnifying glass and choose a command from the dialog box "Choose command".
Example for multiple commands: cm_SelectAll,cm_Copy
User avatar
sidefx88
Senior Member
Senior Member
Posts: 294
Joined: 2007-04-11, 17:07 UTC
Location: Argentina

Post by *sidefx88 »

Thanks, white!

The method you mention is easier and shorter, but the "%COMMANDER_EXE% "c:\your\path" /O /T /S" way works fine for me! :)
I Love Total Commander!
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2white

Thanks!

I expected cm_OpenNewTab,cd "C:\" will work but it isn't
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50923
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2ts4242
You need to put cd "C:\" inside a command (e.g. em_driveC).
Author of Total Commander
https://www.ghisler.com
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

ghisler(Author) wrote:2ts4242
You need to put cd "C:" inside a command (e.g. em_driveC).
Yes i know, but i was trying to find an easy way to access any folder in new tab without creating user command for it!
Post Reply