I am attempting to write a script which will ftp into a server a grab all files from a specific directory. Everyday the name of the directory I need to grab the files from changes based on the ftp servers system data.
Everything works fine with this script:
open ftp server
user username password
ascii
cd /Some.Directory/03-03-2008
lcd C:\some.directory\
mget *
mget *
y
y
y
y
y
y
y
y
bye
I would like to pass a avarialbe to say something like this:
for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do set filedate=%%a-%%b-%%c
and then have my script look like this:
open ftp server
user username password
ascii
cd /Some.Directory/%filedate
lcd C:\some.directory\
mget *
mget *
y
y
y
y
y
y
y
y
bye
I am not sure how to go about getting this done. Please help.
Start Free Trial