Differences

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

2019-08-23 2020-04-17
quotes anchor (martin) Percent Sign (martin)
Line 58: Line 58:
For details, see [[commandline#syntax|escaping the in-command double-quotes by doubling them]]. For details, see [[commandline#syntax|escaping the in-command double-quotes by doubling them]].
 +
 +===== [[percent]] Percent Sign =====
 +
 +If your WinSCP command-line contains percent sign, for example to [[session_url#special|encode special characters in session URL]] (particularly in the credentials), it may conflict with special meaning of the percent sign in Windows batch files.
 +
 +You need to double the percent sign to escape it.
 +
 +For example in the following batch file, the username ''username@domain'' contains the ''@'' sign. As the ''@'' sign has a special meaning in the session URL, it needs to be encoded to ''%40''. But as ''%'' sign has a special meaning in the batch file, it needs to be escaped as ''%%'', resulting in final ''%%40''.
 +
 +<code batch>
 +winscp.com /log=winscp.log /ini=nul /command ^
 +    "open sftp://username%%40domain:password@example.com/" ^
 +    "get *" ^
 +    "exit"
 +</code>

Last modified: by martin