Information about user-defined commands em_
Moderators: Hacker, petermad, Stefan2, white
Information about user-defined commands em_
Hi,
I'm going through TC help file to learn some new things.
Help mentions: "Additionally, you can define your own commands with prefix em_ via "Choose command" and then use them here."
- Not much shows up when searching the help file for "em_". Where can I find more information about userd-defined commands?
- I have no programming skills whatsoever. Is this worth looking into or is this way out of my league?
I'm going through TC help file to learn some new things.
Help mentions: "Additionally, you can define your own commands with prefix em_ via "Choose command" and then use them here."
- Not much shows up when searching the help file for "em_". Where can I find more information about userd-defined commands?
- I have no programming skills whatsoever. Is this worth looking into or is this way out of my league?
I'm currently using Total Commander Version 10.00 64bit
Re: Information about user-defined commands em_
It's very easy.
E.g. you can build user command for run NOTEPAD.EXE and open file from cursor, so set NOTEPAD.EXE as a command and %P%N (file path+name) as a parameter resulting such a entry in USERCMD.INI
[em_notepad]
cmd=NOTEPAD.EXE
param=%P%N
E.g. you can build user command for run NOTEPAD.EXE and open file from cursor, so set NOTEPAD.EXE as a command and %P%N (file path+name) as a parameter resulting such a entry in USERCMD.INI
[em_notepad]
cmd=NOTEPAD.EXE
param=%P%N
Last edited by Gral on 2022-03-23, 16:56 UTC, edited 1 time in total.
Re: Information about user-defined commands em_
An example from my usercmd.ini
em_TeraCopy is the name for adding it into a button or menu
Button defines the icon
Cmd defines the tool to start
Menu is the tooltip for the button
Param contains the parameters for the tool to start
Code: Select all
[em_TeraCopy]
button=c:\tools\TeraCopy\TeraCopy.exe,0
cmd=c:\tools\TeraCopy\TeraCopy.exe
menu=Copy with TeraCopy
param=Copy *"%UL" "%T" /NoClose
Button defines the icon
Cmd defines the tool to start
Menu is the tooltip for the button
Param contains the parameters for the tool to start
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1395a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.4 x64
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1395a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.4 x64
Re: Information about user-defined commands em_
I see, thanks.
2 questions:
2 questions:
- Created your Notepad example with Change start menu. Then %P%N doesn't work for me after selecting a .txt file and then selecting the Notepad command in the start menu. Only works if I change parameters to %P%S. Or should I select files/run command in a different way if parameters are set to %P%N?
- Probably my fault, but from the Notepad example I don't see the advantage of user-defined commands. I already have buttons in Total Commander that have the same functionality. Button command is path to an .exe and parameters is set to %P%S. Same functionality without the need for a user-defined command. What am I missing to understand benefits of userd-defined commands?
I'm currently using Total Commander Version 10.00 64bit
Re: Information about user-defined commands em_
You can add cm_ and em_commands in View mode settings
but not your simple button definitions.
Also you can chain such commands for more complex jobs.
%P%N is normal for single selected files and definitely works in buttons and commands.
Read the button help what %S is for
but not your simple button definitions.
Also you can chain such commands for more complex jobs.
%P%N is normal for single selected files and definitely works in buttons and commands.
Read the button help what %S is for
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1395a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.4 x64
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1395a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.4 x64
Re: Information about user-defined commands em_
Hi,
em_commands are required, for example, to create/re-define shortcuts.
(Configuration -> Options... -> Misc. -> Redefine hotkeys (Keyboard remapping) ...).
Example (shortcut Shift+Y):
It is saved in the file: wincmd.ini in the [Shortcuts] section:
S+Y=em_CD_D-Daten_I-Daten
Furthermore, several commands can be used in one button, including em_commands - example:
3 em_commands for 1 button.
Button with command:
cm_50Percent,em_CD_D-Daten_I-Daten
------------------------------------------------
em_command:em_CD_D-Daten_I-Daten
Command: cm_FocusLeft,cm_SrcActivateTab1,em_D-Daten,cm_TrgActivateTab1,em_I-Daten,cm_FocusLeft,cm_RereadSource,cm_rereadsource 1
em_command:em_D-Daten
Command: cd D:\Daten
em_command:em_I-Daten
Command: command: cd I:\Daten
Important:
No spaces are allowed in the name of em_commands!
This has the effect that after clicking on the button with command: cm_50Percent,em_CD_D-Daten_I-Daten
- the view is set to 50:50, if necessary
- In the left window, the directory D:\Daten\*.* is set for the first tab and this tab is activated
- In the right-hand window, the directory I:\Daten\*.* is set for the first tab (window inactive).
- updates of the view are carried out
Instead of clicking on the button, the shortcut Shift+Y can also be used (if defined - please see above).
The description of the individual commands, e.g. cm_SrcActivateTab1 can be viewed either in the CommandBrowser
(enter cm_CommandBrowser in the command line of Total Commander and press ENTER, then enter the command in the "Filter" field)
or you can search/filter for the term cm_RereadSource in the file HISTORY.TXT.
One can probably list other advantages of em_commands...
em_commands are required, for example, to create/re-define shortcuts.
(Configuration -> Options... -> Misc. -> Redefine hotkeys (Keyboard remapping) ...).
Example (shortcut Shift+Y):
It is saved in the file: wincmd.ini in the [Shortcuts] section:
S+Y=em_CD_D-Daten_I-Daten
Furthermore, several commands can be used in one button, including em_commands - example:
3 em_commands for 1 button.
Button with command:
cm_50Percent,em_CD_D-Daten_I-Daten
------------------------------------------------
em_command:em_CD_D-Daten_I-Daten
Command: cm_FocusLeft,cm_SrcActivateTab1,em_D-Daten,cm_TrgActivateTab1,em_I-Daten,cm_FocusLeft,cm_RereadSource,cm_rereadsource 1
em_command:em_D-Daten
Command: cd D:\Daten
em_command:em_I-Daten
Command: command: cd I:\Daten
Important:
No spaces are allowed in the name of em_commands!
This has the effect that after clicking on the button with command: cm_50Percent,em_CD_D-Daten_I-Daten
- the view is set to 50:50, if necessary
- In the left window, the directory D:\Daten\*.* is set for the first tab and this tab is activated
- In the right-hand window, the directory I:\Daten\*.* is set for the first tab (window inactive).
- updates of the view are carried out
Instead of clicking on the button, the shortcut Shift+Y can also be used (if defined - please see above).
The description of the individual commands, e.g. cm_SrcActivateTab1 can be viewed either in the CommandBrowser
(enter cm_CommandBrowser in the command line of Total Commander and press ENTER, then enter the command in the "Filter" field)
or you can search/filter for the term cm_RereadSource in the file HISTORY.TXT.
One can probably list other advantages of em_commands...
Re: Information about user-defined commands em_
It's just example, as simple as possible to learn how build user command. Benefit in any case is possibility to use user command in menus.kodepr wrote: 2022-03-23, 17:28 UTC ...
Probably my fault, but from the Notepad example I don't see the advantage of user-defined commands. I already have buttons in Total Commander that have the same functionality. Button command is path to an .exe and parameters is set to %P%S. Same functionality without the need for a user-defined command. What am I missing to understand benefits of userd-defined commands?
You can of course make more complex user command.
Re: Information about user-defined commands em_
Here is another small(!) example with step-by-step instructions.
Re: Information about user-defined commands em_
2kodepr
For inspiration you could try my Extended Menus (see signature) - there is more than 550 em_commands in use.
For inspiration you could try my Extended Menus (see signature) - there is more than 550 em_commands in use.
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
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