Differences

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

faq_batch_file 2020-12-02 faq_batch_file 2023-01-16 (current)
Line 41: Line 41:
===== [[newline_escaping]] New-line Escaping ===== ===== [[newline_escaping]] New-line Escaping =====
-Many examples on this site (including the one above), as well as [[ui_generateurl#script|batch file template]] generated by WinSCP, use [[wp>Batch_file#Escaped_characters_in_strings|new-line escaping]] using the caret symbol ''^'' to allow wrapping a long command line to multiple lines for a better readability:+Many examples on this site (including the one above), as well as [[ui_generateurl#script|batch file template]] generated by WinSCP, use [[wp>Batch_file#Escaped_characters_in_strings|new-line escaping]] using the caret symbol ''^'' to allow wrapping a long command line to multiple lines for better readability:
<code batch> <code batch>
Line 73: Line 73:
    "exit"     "exit"
</code> </code>
 +
 +You can avoid the problem by specifying the credentials using the [[scriptcommand_open#username|''-username'']] and [[scriptcommand_open#password|''-password'']] switches:
 +
 +<code batch>
 +winscp.com /log=winscp.log /ini=nul /command ^
 +    "open sftp://example.com/ -username=user@domain -password=password" ^
 +    "get *" ^
 +    "exit"
 +</code>
 +

Last modified: by martin