[Solved] How to connect FTP and download files via Windows cmd script - Slash Engineer 要多斜有多斜

Breaking

Slash Engineer 要多斜有多斜

程式設計的學習過程 (環境設置、開發環境、程式設計、語法練習、資料結構等等...) 99'暑假:六月初開始. 社會新鮮人:十一月初開始.

2020年6月23日 星期二

[Solved] How to connect FTP and download files via Windows cmd script

I create these two script and set up a scheduled task to run FtpScript.bat.
And record running log, you might need to check the date time format in "Date and Time".



FtpScript.bat
cd /d E:\OTTTFiles\TempFiles\Input\
set nYear=%Date:~0,4%
set nMonth=%Date:~5,2%
set nDay=%Date:~8,2%
set GetFTPlog=D:\OTLogs\FtpScript_%nYear%_%nMonth%_%nDay%.log
ftp -s:D:\ScheduleTask\FTPcommand.txt >> %GetFTPlog%



FTPcommand.txt
open 192.168.xx.xx
OTTT
747474YT
binary
prompt
cd \OTTTmsg
mget ProductMessage*otttmg
mdelete ProductMessage*otttmg
disconnect
bye


[img.1] Windows timestamp

沒有留言:

張貼留言

問題沒有大小或好壞