I never wrote batch files before and now I am having this requirement to automatically download files from FTP Server which are delivered between 8 to 11 p.m.
I being a newbie my expert friends can understand my problem and help me in sorting this.
I did google search for downloading files from FTP which i tried i was successful in login. The login result:
ftp> Connected to 172.xx.x.xx.
open 172.xx.x.xx
220 xyz.xyz.com X2 WS_FTP Server 7.5.1
User (172.xx.x.xx:none)):
331 Enter password
230 User logged in
ftp> disconnect
221 bye
ftp> bye
I tried getting directory listing:
dr-x------- 2 xyz System 14 Nov 02 22:27 Invoice-Centre-0311
My 2 issues.
1. To download files from FTP which has current date (ddmmyyyy) in file name, copy them to
D:\Invoice folder, copy only todays date files from server. (approx. 10 to 12 files each of .img & .xml)
FTP Server directory: Invoice-Centre-0311 File Names: INVOICE_990331_1_18112013_18112013_213818_00.img & INVOICE_990331_1_18112013_18112013_213818.XML
The files are delivered between 8 to 11 p.m.the batch file would require to search rescursively and download them.
2. To verify with FTP Server the files downloaded are perfect in size (approx. 15 to 16 MB the .img files) [very very important]
After downloads gets completed to shut down windows.
I will be using windows task scheduler to run this batch file. Win-7
Any help in this will be most appreciated