Advertisement

03.13.2008 at 11:48AM PDT, ID: 23239685 | Points: 500
[x]
Attachment Details

FTP Change to directory with date based variable name

Asked by dmahnken in FTP Servers, All-Purpose Editors & IDEs, File Transfer Protocol (FTP)

Tags:

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
 
 
[+][-]03.14.2008 at 08:31AM PDT, ID: 21126436

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628