# winscp.exe /console /script=sample.txt
# Automatically answer all prompts negatively not to stall
# the script on errors
# option echo on|off
option echo off
# option batch on|off|abort|continue
option batch on
# option confirm on|off
option confirm off
# option transfer binary|ascii|automatic
# option synchdelete on|off
# option exclude clear | [;...]
# option include clear | [;...]
# open [ sftp|ftp|scp:// ][ [ :password ] @ ] [ : ]
# open user:password@example.com
# Connect FTP地址open ftp://用户名:密码@outftp.test.com:21
# Change remote directory
# cd /home/user 如果同步到远程FTP时,可用此命令转到远程某个目录下.
# Change local directory
# set to Self's working dir 设置需要同步到远程FTP的本地文件目录lcd D:TempTest_Ftp
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:
# get examplefile.txt d:
# option synchdelete on|off
option synchdelete off
# option include clear | [;...]
# option include /2008-*-*/;/2009-*-*/;/2010-*-*/;/2011-*-*/;/2012-*-*/;/2013-*-*/
# synchronize local|remote|both [ [ ] ] 从远程同步到本地用Local;从本地同步到远程用Remotesynchronize local
# Disconnect
close
# Exit WinSCP
exit