Hey everyone, I'm currently trying to download files using command prompt via a FTP server.
I'm using a variable as the files would be downloaded at a 15 minute interval.
The file name is according to the current date and the date format is YYMMDD.This is my first batch file, in which i would be creating a folder for the text files to be placed in.
cd C:\data2
set today=%date:~12,4%%date:~4,2%%date:~7,2%
mkdir %today%
cd C:\Users\newacc
call C:\Users\newacc\Desktop\ftp!\FTP!!.batThe batch file would then call for another batch file, which would run the downloading of the text files.
set now=%date:~12,4%%date:~4,2%%date:~7,2%
ftp -v -i -s:C:\Users\newacc\Desktop\ftp!\FTP!.txtopen 10.66.xx.xx
admin
admin
lcd C:\data2\%now%
cd C:\data\%now%
binary
mget "*.*"
disconnect
byeAs there are several text files in each folder, I use mget to retrieve the files. However, the problem I am currently facing is that when the script is running, (lcd and cd), the directory cannot be found. I'm guessing its due to the variable not being recognised.
Someone please help me! I'm really bad at programming and have been searching online for several hours but with no solution. I'd really appreciate any help.
Thanks in advance.
Its okay everyone! I've solved my problem after enduring a few more hours of searching. Cheers!!!
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |