Differences

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

custom_command 2023-03-08 custom_command 2026-02-09 (current)
Line 1: Line 1:
====== Custom Commands ====== ====== Custom Commands ======
-If there is a [[remote command]] you need to execute regularly and in particular if the command works with files, you may find custom commands useful.+If there is a [[remote_command|remote]] or local command you need to execute regularly and in particular if the command works with files, you may find custom commands useful.
A custom command is a [[ui_pref_commands|predefined]] command which can contain several patterns that WinSCP replaces, for example, with names of files selected in a panel (see below). For example, the pre-defined custom command //Touch//, defined as ''touch %%"!"%%'', calls the ''touch'' command on every selected file in the remote panel. A custom command is a [[ui_pref_commands|predefined]] command which can contain several patterns that WinSCP replaces, for example, with names of files selected in a panel (see below). For example, the pre-defined custom command //Touch//, defined as ''touch %%"!"%%'', calls the ''touch'' command on every selected file in the remote panel.
Line 27: Line 27:
| ''!P''  | Any          | Current session password (if [[security_credentials|stored or remembered]]). | | ''!P''  | Any          | Current session password (if [[security_credentials|stored or remembered]]). |
| ''!#''  | Any          | Current session port number. | | ''!#''  | Any          | Current session port number. |
-| ''!K''  | Any          | Current session private key. &beta_feature |+| ''!K''  | Any          | Current session private key. |
| ''!N''  | Any          | Current session name. | | ''!N''  | Any          | Current session name. |
| ''!?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. Special characters entered by user are automatically delimited. You can prohibit this using optional backslash (''\'') before second question mark (''?''). \\ When implementing an [[extension]], use a runtime [[extension#options|option]] instead, as a more flexible alternative. | | ''!?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. Special characters entered by user are automatically delimited. You can prohibit this using optional backslash (''\'') before second question mark (''?''). \\ When implementing an [[extension]], use a runtime [[extension#options|option]] instead, as a more flexible alternative. |

Last modified: by martin