how pass current folder in Change directory menu

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
jmwap
Member
Member
Posts: 121
Joined: 2008-03-23, 12:40 UTC

how pass current folder in Change directory menu

Post by *jmwap »

Hi
I am successfully using Change directory menu to execute some commands, not just for changing current directory.

Now I would like to pass the current folder to the commands I am invoking, I thought there would be a way but I cannot find it in the help.

Is there some placeholder I can put in the Command: field that would be replaced by the current path in current selected TC window?

thanks
umbra
Power Member
Power Member
Posts: 876
Joined: 2012-01-14, 20:41 UTC

Post by *umbra »

It's called "Change directory menu" for a reason. And I can't think of any reason why I would change the current directory to itself.

For custom commands, there is the Start menu. You can access prepared commands either through menu, or assign cm_UserMenu1, cm_UserMenu2, ... to some shortcuts.
Windows 10 Pro x64, Windows 11 Pro x64
User avatar
petermad
Power Member
Power Member
Posts: 16152
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Post by *petermad »

2jmwap

In order to do this, you must use a userdefined command (em_command) in the Command field.

To do this:
1. Open the Change directory menu for editing.
2. Click the button with the magnifying glass to the right of the "Command" field.
3. Scroll down to "usercmd.ini" in the left side of the Choose command window.
4. Click on the button "New..." and give your command a name of your own (it has to start with em_).
5. Now you can enter your command as usual - and in the "Parameters" field you can access the current path with %P or %p or the target path with %T and %t (click Help to see more).
License #524 (1994)
Danish Total Commander Translator
TC 11.55rc4 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1393a
TC 3.60b4 on Android 6, 13, 14
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
jmwap
Member
Member
Posts: 121
Joined: 2008-03-23, 12:40 UTC

Post by *jmwap »

petermad wrote:2jmwap

In order to do this, you must use a userdefined command (em_command) in the Command field.

To do this:
1. Open the Change directory menu for editing.
2. Click the button with the magnifying glass to the right of the "Command" field.
3. Scroll down to "usercmd.ini" in the left side of the Choose command window.
4. Click on the button "New..." and give your command a name of your own (it has to start with em_).
5. Now you can enter your command as usual - and in the "Parameters" field you can access the current path with %P or %p or the target path with %T and %t (click Help to see more).
working wonderfully, thanks petermad
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2jmwap

Actually, Directory Menu has the same ability to use parameters like you do with Start Menu, I have documented this feature for my Directory Menu Editor

Total Commander directory menu can be used to run programs exactly like Total Commander start menu, to show parameters list and window state also in Directory Menu Editor:
  1. Run any text editor program (e.g. Notepad) and open the program INI file "ultra tc editors.ini"
  2. Create the key ShowParamList under [DirectoryMenuEditor] section.
  3. Set the key ShowParamList value to 1
The good news is that, these parameters will remain if you edited the Directory Menu with TC's built-in editor.
Post Reply