Use Windows Batch to FTP file based on filename pattern - TechRepublic
Question
March 31, 2009 at 02:12 PM
shawn.kaelber

Use Windows Batch to FTP file based on filename pattern

by shawn.kaelber . Updated 17 years, 3 months ago

I am trying to run a script to FTP a file from our as/400 to a local PC based on a dynamic filename. The script works as is for a static filename but the actual filenames are based on this pattern:
A+[date]+[batch number] (IE: A033109001, A033109002…)
[date]=MMDDYY

::Batch File
FTP -S:LOGIN.SCR FTP.SERVER.COM

::Login.Scr
USER
PASSWORD
CD ACOM
BINARY
GET A032609001 C:\ACOM\A032609001
BYE

Can I wildcard the filename somehow using the rename date formatting?
IE: a%date:~4,2%%date:~7,2%%date:~12,2%???.*
OR: a%date:~4,2%%date:~7,2%%date:~12,2%*.*

Other suggestions on how to do this?

This discussion is locked

All Comments