User-defined command

From TotalcmdWiki
Revision as of 11:58, 12 October 2009 by White (talk | contribs) (Corrected wiki links)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

User-defined commands can be used to execute external programs in an easy way. In addition they can be used to assign a single name to an internal command which supports parameters. This is required to make them work everywhere.

These commands can be executed in various ways. User-defined commands have the em_ prefix. This is the abbreviation for extended command and was introduced to make them easy distinguishable from internal commands.

Properties

User-defined commands consist of the following properties

  • Command: There are two types of commands
    • An external program or document
    • An internal command
  • Parameters
  • Start path
  • Icon file
  • Icon
  • Tooltip
  • Run minimized/maximized

Use

A user-defined command can be used in many different ways

Managing user-defined commands

Command browser

The command browser can be used to manage commands in Total Commander. It can be used almost everywhere where user-defined can be used. It can be opened by clicking the button with the magnifier.

  • Hotkey- and alias definitions: Menu Configuration/Options/Page Misc./Redifine hotkeys
  • Button bar configuration: Menu Configuration/Change button bar
  • Start menu configuration: Menu Configuration/Change start menu
  • Directory hotlist configuration: Menu Commands/Directory hotlist

Alternatively the command browser can be opened directly be executing the internal command cm_CommandBrowser.

Create user-defined commands

Here are the steps which needs to be taken starting from the command browser

  • Select category usercmd.ini
  • Click button "New"
  • Enter name for user-defined command
  • Enter properties for the user-defined command.
  • Close the dialog by clicking OK.
  • Close the command browser by clicking OK.

If the command browser has been started separately just a user-defined command has been created. If the command browser has been opened from one of the above mentioned configuration dialogs the user-defined command assigned to the appropriate way to execute a command.

Select user-defined command for assignment

Additional assignments can be created at anytime. After executing the command browser from a configuration dialog please follow these steps.

  • Select category usercmd.ini
  • Select user-defined command in the right-hand list.
  • Close command browser by clicking OK.

When creating a hotkey or alias definition you have to click the button with the check mark after creating or selecting the command.

Examples

Execute external program

In this example demonstrates how an external program is executed. The following properties must be entered

Command: %COMMANDER_PATH%\Addons\TC Quick Search Plus\TCQSP.exe
Parameters: %P
Icon file: %COMMANDER_PATH%\Addons\TC Quick Search Plus\TCQSP.exe
Tooltip: Quick filter

Using an internal command with parameters as user-defined command

Internal commands with parameters can be used directly only in button in the buttonbar, in the start menu and in the directory menu. All the other ways to execute a command listed in the section "Use" only work when the internal command with parameters is assigned to an user-defined command. Here is an example to load folder tabs from a file.

Command: OPENTABS %appdata%\Total Commander\Tabs\My Project.tab 
Tooltip: My Project