The example code below connects to 'example.com' with account 'user' and password 'pass123', uploads a file and closes the session. For the sake of this article, let's call this example.ini:
# Automatically abort script on errors option batch abort # Disable overwrite confirmations that conflict with the previous option confirm off # Connect using a password open user:pass123@example.com # Force binary mode transfer option transfer binary # Upload file to the local directory d:\ put examplefile.txt d:\ # Disconnect close
You can then call this script through WinSCP console as follows:
winscp.exe /console /script=example.ini
No comments:
Post a Comment