Difference between revisions of "Winscp command line"

From MyWiki
Jump to: navigation, search
Line 13: Line 13:
 
# Disconnect
 
# Disconnect
 
close
 
close
 +
</source>
 +
Calling a script
 +
<source lang="text">
 +
@echo off
 +
winscp.com /script=myscript.txt
 
</source>
 
</source>

Revision as of 15:03, 18 May 2015

Reference : http://winscp.net/eng/docs/guide_automation
winscp.com /command "open ""My site""" "put ""C:\Users\martin\Documents\myfile.dat"""

# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect to SFTP server using a password
open sftp://user:password@example.com/ -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Upload file
put d:\examplefile.txt /home/user
# Disconnect
close

Calling a script

@echo off
winscp.com /script=myscript.txt