Differences

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

2007-10-05 2008-04-10
i do no understand purpose of the example on the place (martin) 4.1 reordered to correspond to winscp /? (martin)
Line 4: Line 4:
<code> <code>
winscp.exe stored_session winscp.exe stored_session
-winscp.exe [(sftp|ftp|scp)://][user[:password]@]host[:port][/path/[file]] [/privatekey=key_file+winscp.exe [(sftp|ftp|scp)://][user[:password]@]host[:port][/path/[file]] 
-winscp.exe [session] /upload file1 file2 file3 ... [/defaults]+winscp.exe [session] [/console] [/script=script_file] [/command command1 command2 ...]
winscp.exe [session] /synchronize [local_directory] [remote_directory] [/defaults] winscp.exe [session] /synchronize [local_directory] [remote_directory] [/defaults]
winscp.exe [session] /keepuptodate [local_directory] [remote_directory] [/defaults] winscp.exe [session] /keepuptodate [local_directory] [remote_directory] [/defaults]
-winscp.exe [session] [/console] [/script=script_file] [/command command1 command2 ...] +winscp.exe [session] /upload file1 file2 file3 ... [/defaults
-winscp.exe /update+winscp.exe [session] [/privatekey=&lt;key_file&gt;]
winscp.exe /ini=<inifile> /log=<logfile> winscp.exe /ini=<inifile> /log=<logfile>
 +winscp.exe /update
winscp.exe /help winscp.exe /help
</code> </code>
 +
The first syntax opens the stored session. The second creates the session specified by at least hostname, optionally by name of protocol, port number, username, password and initial remote path. In both cases, when only hostname is known, only Login dialog is shown with pre-filled hostname. Otherwise connection attempt is started immediately. If the remote path is not ended by slash (''/''), it is treated as path to file (or even directory) that should be downloaded. Special characters (like ''@'' in username) can be encoded using ''%XX'' syntax, where ''XX'' is hexadecimal ASCII code. The first syntax opens the stored session. The second creates the session specified by at least hostname, optionally by name of protocol, port number, username, password and initial remote path. In both cases, when only hostname is known, only Login dialog is shown with pre-filled hostname. Otherwise connection attempt is started immediately. If the remote path is not ended by slash (''/''), it is treated as path to file (or even directory) that should be downloaded. Special characters (like ''@'' in username) can be encoded using ''%XX'' syntax, where ''XX'' is hexadecimal ASCII code.
-Parameter ''/privatekey'' specifies default [[public_key#private|private key file]] for all sessions. It is used when the particular session has no explicit key specified only.+Parameter ''/console'' executes WinSCP in [[scripting|console (scripting) mode]]. Note that when WinSCP is executed via [[scripting#console|console interface (winscp.com)]], the ''/console'' parameter is not necessary.·
-With ''/upload'' parameter WinSCP uploads specified files to remote directory of session defined using one of the previous syntaxes. A dialog to set options is displayed first (Note that this is not intended for automation, see [[scripting]], but to allow [[integration#exporer_s_send_to_context_menu|Explorer's 'Send To' menu]] integration).+To run batch script either pass script file using ''/script'' parameter or specify the commands directly on command line using ''/command''. In the latter case each following parameter is treated as single command (If the command includes spaces, enclose it in quotes). If both ''/script'' and ''/command'' parameters are used, commands from script file are executed first. When the last command is not ''exit'', regular non-batch mode follows. If ''/console'' parameter is not used along with ''/script'' or ''/command'', the script/command is executed without visual feedback (window).
With ''/synchronize'' or ''/keepuptodate'' parameter WinSCP performs //Synchronize// or //Keep remote directory up to date// commands respectively on the specified session and directories. A dialog to set options is displayed first (Note that this is not intended for automation, see [[scripting]]). With ''/synchronize'' or ''/keepuptodate'' parameter WinSCP performs //Synchronize// or //Keep remote directory up to date// commands respectively on the specified session and directories. A dialog to set options is displayed first (Note that this is not intended for automation, see [[scripting]]).
 +
 +With ''/upload'' parameter WinSCP uploads specified files to remote directory of session defined using one of the previous syntaxes. A dialog to set options is displayed first (Note that this is not intended for automation, see [[scripting]], but to allow [[integration#exporer_s_send_to_context_menu|Explorer's 'Send To' menu]] integration).
Use ''/defaults'' parameter along with ''/upload'', ''/synchronize'' or ''/keepuptodate'' to skip the settings dialog and start the operation straight away with default settings. Use ''/defaults'' parameter along with ''/upload'', ''/synchronize'' or ''/keepuptodate'' to skip the settings dialog and start the operation straight away with default settings.
-Parameter ''/console'' executes WinSCP in [[scripting|console (scripting) mode]]. Note that when WinSCP is executed via [[scripting#console|console interface (winscp.com)]], the ''/console'' parameter is not necessary.  +Parameter ''/privatekey'' specifies default [[public_key#private|private key file]] for all sessions. It is used when the particular session has no explicit key specified only.
- +
-To run batch script either pass script file using ''/script'' parameter or specify the commands directly on command line using ''/command''. In the latter case each following parameter is treated as single command (If the command includes spaces, enclose it in quotes). If both ''/script'' and ''/command'' parameters are used, commands from script file are executed first. When the last command is not ''exit'', regular non-batch mode follows. If ''/console'' parameter is not used along with ''/script'' or ''/command'', the script/command is executed without visual feedback (window). +
- +
-When run with ''/update'' parameter, WinSCP only checks for its [[updates|updates]].+
With ''/ini'' parameter you may specify path to [[config|configuration INI file]]. It effectively disables using [[config|registry as configuration storage]]. If the file does not exist, default configuration will be used and the file will be created. You can use environment variables in the path, with syntax ''%NAME%''. With ''/ini'' parameter you may specify path to [[config|configuration INI file]]. It effectively disables using [[config|registry as configuration storage]]. If the file does not exist, default configuration will be used and the file will be created. You can use environment variables in the path, with syntax ''%NAME%''.
With ''/log'' parameter you may turn on session logging to given file. You can use environment variables in the path, with syntax ''%NAME%''. With ''/log'' parameter you may turn on session logging to given file. You can use environment variables in the path, with syntax ''%NAME%''.
 +
 +When run with ''/update'' parameter, WinSCP only checks for its [[updates|updates]].
Parameter ''/help'' shows usage (overview similar to this). Parameter ''/help'' shows usage (overview similar to this).
For security reasons, when protocol (''%%sftp://%%'', ''%%ftp://%%'' or ''%%scp://%%'') is provided on command line (possible execution from web browser/Windows Explorer), all command-like parameters that cause any automatic action are ignored, including ''/defaults'', ''/log'', ''/script'' and ''/command''. For security reasons, when protocol (''%%sftp://%%'', ''%%ftp://%%'' or ''%%scp://%%'') is provided on command line (possible execution from web browser/Windows Explorer), all command-like parameters that cause any automatic action are ignored, including ''/defaults'', ''/log'', ''/script'' and ''/command''.

Last modified: by martin