Background: Before writing the upload file, now is the download file
Note: Commands need to be executed on one line, variable settings can be divided into multiple lines
---------------------------------------------------Split Line----------------------------------------------------------
:: Setting parameters
:: WINSCP Installation path
SET ROOTPATH=C:\KIT\WINSCP
:: Sftp Path
SET Sftppath=sftp://user:[email protected]:p ORT
:: Local file path (Windows)
SET localfilepath=c:\users\island\desktop\upload\
:: Destination file path (Linux)
SET Targetfilepath=/usr/upload
:: Local Log flag
SET Logpath=/log
:: Local log file name
SET Logfilename=download_log_file.txt
:: Command parsing
:: Winscp.exe/console/command "option Batch Continue" "option confirm off" "open Sftp://user:[email Protected]:p ort" "opt Ion transfer binary "put/server file directory d:\ file path to upload" "Exit"/log=log_file.txt
:: Winscp.exe/console/command---command name
:: "option Batch Continue"---default batch
:: "option confirm off"---to turn off prompt information
:: "Open ftp://user:[email protected]:p ORT user"---access username, pwd: User password, IP:IP address, Port: port number Default 22
:: "option transfer binary"---sent using binary format
:: Log=log_file.txt---Log file address
:: "Exit"---run out
CD%rootpath%
Winscp.exe/console/command "option Batch Continue" "option confirm off" "Open%sftppath%" "option transfer binary" "get %targetfilepath%%localfilepath% "Exit"%logpath%=%logfilename%
WINSCP Bulk Download Script