View Single Post
Old Apr 11th, 2008, 10:53 PM   #1
Jabo
Not a user?
 
Join Date: Sep 2007
Posts: 256
Rep Power: 2 Jabo is on a distinguished road
DOS batch files question

I'm trying to set up some batch files to retrieve some files from a server according to the date in the file name and I'm wondering if this will work also in my ftp scripts or if I have to learn scripting to be able to do this

I call my script from my batch file like so:

batch Syntax (Toggle Plain Text)
  1. ftp -s:file_retrieve.txt

file_retrieve.txt looks like this now:

script Syntax (Toggle Plain Text)
  1. open server
  2. username
  3. password
  4. binary
  5. lcd c:\temp
  6. get filea20080411.dat filea20080411.dat_1
  7. get fileb20080411.dat fileb20080411.dat_1
  8. get filec20080411.dat filec20080411.dat_1
  9. bye

and I'm wanting to change the get lines to be:

script Syntax (Toggle Plain Text)
  1. get file*%date:~-4,4%%date:~4,2%%date:~7,2%.dat file*%date:~-4,4%%date:~4,2%%date:~7,2%.dat_1

also replacing the 3 lines with one with a wild card
Jabo is offline   Reply With Quote