Differences

This shows you the differences between the selected revisions of the page.

2005-02-04 2005-04-05
ui_commander#command_line (martin) Custom Commands (martin)
Line 10: Line 10:
===== Custom Commands ===== ===== Custom Commands =====
-If there is command you need to execute regularly and in particular if the command works with files, you can find Custom commands useful.+If there is command you need to execute regularly and in particular if the command works with files, you can find custom commands useful.
-The Custom command is predefined command, which can contain several patterns, which WinSCP replaces for example with names of files selected in panel. For example pre-defined custom command //Touch//, defined as ''touch "!"'', calls ''touch'' command on every selected file in remote panel.+The custom command is predefined command, which can contain several patterns, which WinSCP replaces for example with names of files selected in panel, see below. For example pre-defined custom command //Touch//, defined as ''touch "!"'', calls ''touch'' command on every selected file in remote panel.
-Custom commands are located in menu //File(s) > Custom Commands// and also in file context menu. Custom commands can be configured in [[ui_references|Preferences]].+There are basically three types of custom commands: 
 +  * Remote commands are executed on the remote servers with the remote files. These commands can modify the files. 
 +  * Local commands are executed on the local machine with the remote files downloaded to [[temp_folders|temporary folder]]. It makes no sense for the command to modify the files, because they are not uploaded back after the command finishes. 
 +  * Special type is local command that is executed both with local and remote files. This is particuarly useful for running "diff" tools. This type is available only with [[ui_commander|Norton Commander interface]]. You can execute such command for set of remote files against the the same number or local files (once for each pair). Another option is to execute it for set of remote files against one local file (once for each remote file) and vice versa. 
 + 
 +You can use following patterns in your custom commands: 
 +^ Pattern ^ Command Type ^ Descriptions ^ 
 +| ''!!''  | Any          | Is replaced with exclamation mark (''!''). | 
 +| ''!''  | Any          | Name of file. Command with the pattern will be executed once for every selected file. In general it should be surrounded with quotes for the command to work with filenames containing spaces. Cannot be combined with pattern ''!&''. | 
 +| ''!&''  | Any          | Quoted, space-delimited list of files. Command with the pattern will be executed only once for all selected files. Cannot be combined with pattern ''!'' and executed recursivelly. | 
 +| ''!?prompt?default!'' | Any | When used, user is prompted to enter value that replaces the pattern. ''prompt'' can define a message of the prompt and ''default'' a default value, both can be empty. | 
 +| ''%%!^!%%''    | Local        | Name of local file. In general it should be used in combination with ''!'' or ''!&''. Command with the pattern will be executed once for every selected local file, unless only one local file and several remote files are selected and pattern ''!'' is used. Cannot be executed recursivelly. | 
 + 
 +The custom command is executed for files selected in [[ui_file_panel|file panel]]. It can be optionally executed also for selected directories or for files in selected directories (or both). 
 + 
 +Custom commands are located in menu //File(s) > Custom Commands// and also in file [[ui_context_menu|context menu]]. Custom commands can be configured in [[ui_pref_commands|Preferences]].

Last modified: by martin