Differences

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

2011-06-05 2011-07-31
no summary (Petr) scriptcommand (martin)
Line 22: Line 22:
To further analyze results of scripted operations, you will find [[logging_xml|XML logging]] useful. To further analyze results of scripted operations, you will find [[logging_xml|XML logging]] useful.
 +
 +===== [[syntax]] Commands Syntax =====
 +All WinSCP commands have syntax:
 +<code>
 +command -switch -switch2 parameter1 parameter2 ... parametern
 +<code>
 +
 +Command parameters that include space(s) have to be enclosed in double-quotes. To use double-quote literally, double it:
 +<code winscp>
 +put "file with spaces and ""quotes"".html"
 +</code>
 +
 +You can use environment variables in the commands, with syntax ''%NAME%'' ((Generally do enclose reference to double-quotes to cope properly with spaces in its value.)):
 +<code winscp>
 +put "%FILE_TO_UPLOAD%"
 +</code>
 +
 +You can reference script arguments (passed on command-line using parameter ''[[commandline#scripting|/parameter]]'') using syntax ''%N%'', where ''N'' is ordinal number of argument ((Generally do enclose reference to double-quotes to cope properly with spaces in its value.)):
 +<code winscp>
 +put "%1%"
 +</code>
 +
 +Note that WinSCP treats filenames in case sensitive manner. So even if your server treats filenames in case insensitive manner, make sure you specify case properly((This is important particularly for FTP sessions.)).
===== Commands ===== ===== Commands =====
-The following [[script_commands|commands]] are implemented:+The following commands are implemented. 
 + 
 +To see help for the command, read respective documentation article below or type command ''[[script_commands_help|help <command>]]'' directly in console.
^ Command                          ^ Description ^ ^ Command                          ^ Description ^
-| [[script_commands#call|call]]    | Executes arbitrary remote shell command | +| [[scriptcommand_call|call]]    | Executes arbitrary remote shell command | 
-| [[script_commands#cd|cd]]        | Changes remote working directory | +| [[scriptcommand_cd|cd]]        | Changes remote working directory | 
-| [[script_commands#chmod|chmod]]  | Changes permissions of remote file | +| [[scriptcommand_chmod|chmod]]  | Changes permissions of remote file | 
-| [[script_commands#close|close]]  | Closes session | +| [[scriptcommand_close|close]]  | Closes session | 
-| [[script_commands#exit|exit]]    | Closes all sessions and terminates the program | +| [[scriptcommand_exit|exit]]    | Closes all sessions and terminates the program | 
-| [[script_commands#get|get]]      | Downloads file from remote directory to local directory | +| [[scriptcommand_get|get]]      | Downloads file from remote directory to local directory | 
-| [[script_commands#help|help]]    | Displays help | +| [[scriptcommand_help|help]]    | Displays help | 
-| [[script_commands#keepuptodate|keepuptodate]] | Continuously reflects changes in local directory on remote one | +| [[scriptcommand_keepuptodate|keepuptodate]] | Continuously reflects changes in local directory on remote one | 
-| [[script_commands#lcd|lcd]]      | Changes local working directory | +| [[scriptcommand_lcd|lcd]]      | Changes local working directory | 
-| [[script_commands#lls|lls]]      | Lists the contents of local directory | +| [[scriptcommand_lls|lls]]      | Lists the contents of local directory | 
-| [[script_commands#ln|ln]]        | Creates remote symbolic link | +| [[scriptcommand_ln|ln]]        | Creates remote symbolic link | 
-| [[script_commands#lpwd|lpwd]]    | Prints local working directory | +| [[scriptcommand_lpwd|lpwd]]    | Prints local working directory | 
-| [[script_commands#ls|ls]]        | Lists the contents of remote directory | +| [[scriptcommand_ls|ls]]        | Lists the contents of remote directory | 
-| [[script_commands#mkdir|mkdir]]  | Creates remote directory | +| [[scriptcommand_mkdir|mkdir]]  | Creates remote directory | 
-| [[script_commands#mv|mv]]        | Moves or renames remote file | +| [[scriptcommand_mv|mv]]        | Moves or renames remote file | 
-| [[script_commands#open|open]]    | Connects to server | +| [[scriptcommand_open|open]]    | Connects to server | 
-| [[script_commands#option|option]] | Sets or shows value of script options | +| [[scriptcommand_option|option]] | Sets or shows value of script options | 
-| [[script_commands#put|put]]      | Uploads file from local directory to remote directory | +| [[scriptcommand_put|put]]      | Uploads file from local directory to remote directory | 
-| [[script_commands#pwd|pwd]]      | Prints remote working directory | +| [[scriptcommand_pwd|pwd]]      | Prints remote working directory | 
-| [[script_commands#rm|rm]]        | Removes remote file | +| [[scriptcommand_rm|rm]]        | Removes remote file | 
-| [[script_commands#rmdir|rmdir]]  | Removes remote directory | +| [[scriptcommand_rmdir|rmdir]]  | Removes remote directory | 
-| [[script_commands#session|session]] | Lists connected sessions or selects active session | +| [[scriptcommand_session|session]] | Lists connected sessions or selects active session | 
-| [[script_commands#synchronize|synchronize]] | Synchronizes remote directory with local one |+| [[scriptcommand_synchronize|synchronize]] | Synchronizes remote directory with local one |
===== [[console]] The Console Interface Tool ===== ===== [[console]] The Console Interface Tool =====

Last modified: by martin