Differences

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

commandline 2025-10-13 commandline 2025-10-13 (current)
Line 1: Line 1:
====== Command-line Options ====== ====== Command-line Options ======
- 
===== [[parameters]] Parameters ===== ===== [[parameters]] Parameters =====
-Parameters for ''[[executables|winscp.exe]]'' executable: +Parameters for ''[[executables|winscp.exe]]'' executable: 
-&amp;lt;code batch&amp;gt;+<code batch>
winscp.exe site|workspace|folder winscp.exe site|workspace|folder
-winscp.exe &amp;lt;session_url&amp;gt;[/path/[file]] +winscp.exe <session_url>[/path/[file]] 
-winscp.exe [mysession] [/sessionname=&amp;lt;name&amp;gt;]+winscp.exe [mysession] [/sessionname=<name>]
winscp.exe [mysession] [/newinstance] winscp.exe [mysession] [/newinstance]
-winscp.exe [mysession] /edit &amp;lt;path&amp;gt; +winscp.exe [mysession] /edit <path> 
-winscp.exe [mysession] /browse[=&amp;lt;file&amp;gt;]+winscp.exe [mysession] /browse[=<file>]
winscp.exe [mysession] /synchronize [local_directory] [remote_directory] [/defaults[=secs]] winscp.exe [mysession] /synchronize [local_directory] [remote_directory] [/defaults[=secs]]
winscp.exe [mysession] /keepuptodate [local_directory] [remote_directory] [/defaults[=secs]] winscp.exe [mysession] /keepuptodate [local_directory] [remote_directory] [/defaults[=secs]]
winscp.exe [mysession] /refresh [path] winscp.exe [mysession] /refresh [path]
winscp.exe [mysession] /upload file1 file2 file3 ... [/defaults[=secs]] winscp.exe [mysession] /upload file1 file2 file3 ... [/defaults[=secs]]
-winscp.exe [mysession] [/privatekey=&amp;lt;file&amp;gt; [/passphrase=&amp;lt;passphrase&amp;gt;]] +winscp.exe [mysession] [/privatekey=<file> [/passphrase=<passphrase>]] 
-winscp.exe [mysession] [/hostkey=&amp;lt;fingerprint&amp;gt;] +winscp.exe [mysession] [/hostkey=<fingerprint>] 
-winscp.exe [mysession] [/username=&amp;lt;user&amp;gt;] [/password=&amp;lt;pass&amp;gt;]+winscp.exe [mysession] [/username=<user>] [/password=<pass>]
winscp.exe [mysession] [/passwordsfromfiles] winscp.exe [mysession] [/passwordsfromfiles]
-winscp.exe [mysession] [/clientcert=&amp;lt;file&amp;gt; [/passphrase=&amp;lt;passphrase&amp;gt;]] +winscp.exe [mysession] [/clientcert=<file> [/passphrase=<passphrase>]] 
-winscp.exe [mysession] [/certificate=&amp;lt;fingerprint&amp;gt;]+winscp.exe [mysession] [/certificate=<fingerprint>]
winscp.exe [mysession] [/passive[=on|off]] [/implicit|explicit] winscp.exe [mysession] [/passive[=on|off]] [/implicit|explicit]
-winscp.exe [mysession] [/timeout=&amp;lt;sec&amp;gt;]+winscp.exe [mysession] [/timeout=<sec>]
winscp.exe [mysession] [/rawsettings setting1=value1 setting2=value2 ...] winscp.exe [mysession] [/rawsettings setting1=value1 setting2=value2 ...]
-winscp.exe [/console] [/script=&amp;lt;script_file&amp;gt;] [/command command1 command2 ...]+winscp.exe [/console] [/script=<script_file>] [/command command1 command2 ...]
          [/parameter // param1 ...]           [/parameter // param1 ...]
-winscp.exe [/log=&amp;lt;logfile&amp;gt;  [/loglevel=&amp;lt;level&amp;gt;] [/logsize=[&amp;lt;count&amp;gt;*]&amp;lt;size&amp;gt;]] +winscp.exe [/log=<logfile>  [/loglevel=<level>] [/logsize=[<count>*]<size>]] 
-          [/xmllog=&amp;lt;logfile&amp;gt; [/xmlgroups]] +          [/xmllog=<logfile> [/xmlgroups]] 
-winscp.exe [/ini=&amp;lt;inifile&amp;gt;]+winscp.exe [/ini=<inifile>]
winscp.exe [/rawconfig config1=value1 config2=value2 ...] winscp.exe [/rawconfig config1=value1 config2=value2 ...]
winscp.exe [/rawtransfersettings setting1=value1 setting2=value2 ...] winscp.exe [/rawtransfersettings setting1=value1 setting2=value2 ...]
-winscp.exe /batchsettings &amp;lt;site_mask&amp;gt; setting1=value1 setting2=value2 ... +winscp.exe /batchsettings <site_mask> setting1=value1 setting2=value2 ... 
-winscp.exe /keygen keyfile [/output=&amp;lt;file&amp;gt;] [/changepassphrase] +winscp.exe /keygen keyfile [/output=<file>] [/changepassphrase] 
-winscp.exe /keygen keyfile [/comment=&amp;lt;text&amp;gt;] [/certificate=&amp;lt;file&amp;gt;]+winscp.exe /keygen keyfile [/comment=<text>] [/certificate=<file>]
winscp.exe /copyid /identity=publickey mysession winscp.exe /copyid /identity=publickey mysession
winscp.exe /update winscp.exe /update
winscp.exe /info winscp.exe /info
winscp.exe /help winscp.exe /help
-&amp;lt;/code&amp;gt;+</code>
-Parameters for &amp;#039;&amp;#039;[[executables|winscp.com]]&amp;#039;&amp;#039; executable: +Parameters for ''[[executables|winscp.com]]'' executable: 
-&amp;lt;code batch&amp;gt;+<code batch>
winscp.com [/script=script_file] [/command command1 command2 ...] winscp.com [/script=script_file] [/command command1 command2 ...]
          [/parameter // param1 ...]           [/parameter // param1 ...]
winscp.com [/stdout[=binary|chunked]] [/stdin] winscp.com [/stdout[=binary|chunked]] [/stdin]
-winscp.com [/log=&amp;lt;logfile&amp;gt; [/loglevel=&amp;lt;level&amp;gt;] [/logsize=[&amp;lt;count&amp;gt;*]&amp;lt;size&amp;gt;]] +winscp.com [/log=<logfile> [/loglevel=<level>] [/logsize=[<count>*]<size>]] 
-          [/xmllog=&amp;lt;logfile&amp;gt; [/xmlgroups]] [/nointeractiveinput] +          [/xmllog=<logfile> [/xmlgroups]] [/nointeractiveinput] 
-winscp.com [/ini=&amp;lt;inifile&amp;gt;]+winscp.com [/ini=<inifile>]
winscp.com [/rawconfig config1=value1 config2=value2 ...] winscp.com [/rawconfig config1=value1 config2=value2 ...]
-winscp.com /batchsettings &amp;lt;site_mask&amp;gt; setting1=value1 setting2=value2 ... +winscp.com /batchsettings <site_mask> setting1=value1 setting2=value2 ... 
-winscp.com /keygen keyfile [/output=&amp;lt;file&amp;gt;] [/changepassphrase] +winscp.com /keygen keyfile [/output=<file>] [/changepassphrase] 
-winscp.com /keygen keyfile [/comment=&amp;lt;text&amp;gt;] [/certificate=&amp;lt;file&amp;gt;]+winscp.com /keygen keyfile [/comment=<text>] [/certificate=<file>]
winscp.exe /copyid /identity=publickey mysession winscp.exe /copyid /identity=publickey mysession
winscp.com /info winscp.com /info
winscp.com /help winscp.com /help
-&amp;lt;/code&amp;gt; +</code>
- +
==== [[session]] Session ==== ==== [[session]] Session ====
-The first syntax opens the [[session_configuration#site|site]]. To open site, stored in folder, use path syntax &amp;quot;folder/site&amp;quot;. You can also open [[workspace|workspace]] or all sites in site folder.+The first syntax opens the [[session_configuration#site|site]]. To open site, stored in folder, use path syntax "folder/site". You can also open [[workspace|workspace]] or all sites in site folder.
-The second creates the session specified by [[session_url|session URL]] and optionally by initial remote path. If the remote path is not ended by slash (&amp;#039;&amp;#039;/&amp;#039;&amp;#039;), it is treated as path to file (or even directory) that should be [[task_download#url|downloaded]]. +The second creates the session specified by [[session_url|session URL]] and optionally by initial remote path. If the remote path is not ended by slash (''/''), it is treated as path to file (or even directory) that should be [[task_download#url|downloaded]].
-The parameter &amp;#039;&amp;#039;/==sessionname==&amp;#039;&amp;#039; specifies a custom name of the session to be used instead of the automatically generated name in a format &amp;#039;&amp;#039;username@hostname&amp;#039;&amp;#039; or to override the name of the saved site.+The parameter ''/==sessionname=='' specifies a custom name of the session to be used instead of the automatically generated name in a format ''username@hostname'' or to override the name of the saved site.
-If there&amp;#039;s already an idle WinSCP instance running, the session(s) opens in the existing instance. To force the session to open in a new instance of WinSCP, use &amp;#039;&amp;#039;/==newinstance==&amp;#039;&amp;#039; parameter. If no session is specified on command-line, [[ui_login|Login dialog]] opens to select one.+If there's already an idle WinSCP instance running, the session(s) opens in the existing instance. To force the session to open in a new instance of WinSCP, use ''/==newinstance=='' parameter. If no session is specified on command-line, [[ui_login|Login dialog]] opens to select one.
-The parameter &amp;#039;&amp;#039;/==privatekey==&amp;#039;&amp;#039; specifies a [[local_path|local path]] to an [[public_key#private|SSH private key file]]. If the key file is encrypted, use the &amp;#039;&amp;#039;/passphrase&amp;#039;&amp;#039; to specify its passphrase. The passphrase [[#passwordsfromfiles|can be read from a file]].+The parameter ''/==privatekey=='' specifies a [[local_path|local path]] to an [[public_key#private|SSH private key file]]. If the key file is encrypted, use the ''/passphrase'' to specify its passphrase. The passphrase [[#passwordsfromfiles|can be read from a file]].
-The parameter &amp;#039;&amp;#039;/hostkey&amp;#039;&amp;#039; specifies the fingerprint of the expected SSH host key (or several alternative fingerprints separated by a semicolon). It makes WinSCP automatically [[ssh_verifying_the_host_key|accept the host key]] with the fingerprint. +The parameter ''/hostkey'' specifies the fingerprint of the expected SSH host key (or several alternative fingerprints separated by a semicolon). It makes WinSCP automatically [[ssh_verifying_the_host_key|accept the host key]] with the fingerprint.
-You can use the parameters &amp;#039;&amp;#039;/==username==&amp;#039;&amp;#039; and &amp;#039;&amp;#039;/password&amp;#039;&amp;#039; as an alternative way to specify the credentials.  The credentials are normally part of the [[session_url|session URL]]. Using these switches has the advantage of not needing to [[session_url#special|URL-encode special characters]]. The password [[#passwordsfromfiles|can be read from a file]].+You can use the parameters ''/==username=='' and ''/password'' as an alternative way to specify the credentials.  The credentials are normally part of the [[session_url|session URL]]. Using these switches has the advantage of not needing to [[session_url#special|URL-encode special characters]]. The password [[#passwordsfromfiles|can be read from a file]].
-With parameter &amp;#039;&amp;#039;/==passwordsfromfiles==&amp;#039;&amp;#039;, the values of [[#username|&amp;#039;&amp;#039;/password&amp;#039;&amp;#039;]], [[#privatekey|&amp;#039;&amp;#039;/passphrase&amp;#039;&amp;#039;]] and in general all passwords from all sources are interpreted as paths to files, where the actual passwords are read from. The files must use UTF-8 or UTF-16 encoding.((With UTF-8 encoding use of BOM is optional. With UTF-16 the BOM is mandatory. Only the first line of the file is considered. Use of more lines is reserved for the future.))+With parameter ''/==passwordsfromfiles=='', the values of [[#username|''/password'']], [[#privatekey|''/passphrase'']] and in general all passwords from all sources are interpreted as paths to files, where the actual passwords are read from. The files must use UTF-8 or UTF-16 encoding.((With UTF-8 encoding use of BOM is optional. With UTF-16 the BOM is mandatory. Only the first line of the file is considered. Use of more lines is reserved for the future.))
-The parameter &amp;#039;&amp;#039;/clientcert&amp;#039;&amp;#039; specifies a [[local_path|local path]] to FTPS or WebDAVS [[tls#client_certificate|TLS/SSL client certificate]]. If the certificate is encrypted, use the &amp;#039;&amp;#039;/passphrase&amp;#039;&amp;#039; to specify its passphrase.+The parameter ''/clientcert'' specifies a [[local_path|local path]] to FTPS or WebDAVS [[tls#client_certificate|TLS/SSL client certificate]]. If the certificate is encrypted, use the ''/passphrase'' to specify its passphrase.
-When a FTPS or WebDAVS server [[tls#certificate|TLS/SSL certificate]] is not trusted (typically a self-signed certificate), use the parameter &amp;#039;&amp;#039;/certificate&amp;#039;&amp;#039; to specify the fingerprint of the untrusted certificate. It makes WinSCP trust the certificate. Several alternative fingerprints can be separated by a semicolon.+When a FTPS or WebDAVS server [[tls#certificate|TLS/SSL certificate]] is not trusted (typically a self-signed certificate), use the parameter ''/certificate'' to specify the fingerprint of the untrusted certificate. It makes WinSCP trust the certificate. Several alternative fingerprints can be separated by a semicolon.
-The parameter &amp;#039;&amp;#039;/passive&amp;#039;&amp;#039; enables a [[ui_login_connection#connection|passive]] (&amp;#039;&amp;#039;=on&amp;#039;&amp;#039;) or an active (&amp;#039;&amp;#039;=off&amp;#039;&amp;#039;) transfer mode ([[FTP]] protocol only).+The parameter ''/passive'' enables a [[ui_login_connection#connection|passive]] (''=on'') or an active (''=off'') transfer mode ([[FTP]] protocol only).
-The parameters &amp;#039;&amp;#039;/implicit&amp;#039;&amp;#039;, and &amp;#039;&amp;#039;/explicit&amp;#039;&amp;#039; enable respective [[ftps#methods|method of invoking FTPS]].+The parameters ''/implicit'', and ''/explicit'' enable respective [[ftps#methods|method of invoking FTPS]].
-The parameter &amp;#039;&amp;#039;/timeout&amp;#039;&amp;#039; specifies [[ui_login_connection#timeout|server response timeout]].+The parameter ''/timeout'' specifies [[ui_login_connection#timeout|server response timeout]].
-The parameter &amp;#039;&amp;#039;/==rawsettings==&amp;#039;&amp;#039; allows configuring any site settings [[rawsettings|using raw format as in an INI file]]. E.g. to enable an SSH compression and an agent forwarding, use &amp;#039;&amp;#039;/rawsettings Compression=1 AgentFwd=1&amp;#039;&amp;#039;. The parameter must come after the session URL (if any).+The parameter ''/==rawsettings=='' allows configuring any site settings [[rawsettings|using raw format as in an INI file]]. E.g. to enable an SSH compression and an agent forwarding, use ''/rawsettings Compression=1 AgentFwd=1''. The parameter must come after the session URL (if any).
-When using [[scripting]], use the &amp;#039;&amp;#039;[[scriptcommand_open|open]]&amp;#039;&amp;#039; command (and its switches) instead.+When using [[scripting]], use the ''[[scriptcommand_open|open]]'' command (and its switches) instead.
Examples: Examples:
-&amp;lt;code batch&amp;gt; +<code batch> 
-winscp.exe &amp;quot;My site&amp;quot; +winscp.exe "My site" 
-winscp.exe sftp://martin:password@example.com/ /hostkey=&amp;quot;ssh-rsa 2048 xxxxxxxxxxx...&amp;quot;+winscp.exe sftp://martin:password@example.com/ /hostkey="ssh-rsa 2048 xxxxxxxxxxx..."
winscp.exe scp://test@example.com:2222/ /privatekey=mykey.ppk winscp.exe scp://test@example.com:2222/ /privatekey=mykey.ppk
winscp.exe ftps://martin:password@example.com/ winscp.exe ftps://martin:password@example.com/
-&amp;lt;/code&amp;gt; +</code>
==== [[logging]] Logging ==== ==== [[logging]] Logging ====

Last modified: by 41.216.188.234