I use the following bat file:
::@echo off
cd /d %0\..
set cmd=%CD%
echo user %~2> %cmd%\ftpcmd.dat
echo %~3>> %cmd%\ftpcmd.dat
echo bin>> %cmd%\ftpcmd.dat
IF NOT "%5" == "" echo cd %~5>> %cmd%\ftpcmd.dat
echo get %~4 %cmd%\%~4>> %cmd%\ftpcmd.dat
echo quit>> %cmd%\ftpcmd.dat
ftp -n -s:%cmd%\ftpcmd.dat %1
del %cmd%\ftpcmd.dat
Parameters and executions are like below:
c:\download.bat ftpHost login password file.xml FTP_FOLDER
As you can see this script copy file with the specific name.
How can I change this script to look for the first XML file that starts with a certain string. So instead of file.xml
I want pass beginning_of_the_string
(without .xml
). Then script should copy the first of these files?