I'm not familiar with that FTP stuff. For that reason I normally avoid to reply to such topics. But in your case it's obvious why it doesn't work.
You have to strictly separate the following:
1. Batch files are interpreted by cmd.exe. The commands in a batch file have nothing to do with the commands for FTP (even if they have sometimes the same name or a similar behaviour).
2. FTP is a command line tool. It can be called from a batch file but it has nothing to do with batch(-language). That means the Windows FTP tool does not support variables, string manipulation or anything else you could do with a batch code.
3. A FTP text file (referred by ftp-option -s: and the file name) is only a simple text file that contains the FTP commands in the order how the FTP tool has to process them. It belongs clearly to the FTP tool. If it contains batch code then the FTP tool is neither able to interpret it nor to process it.
The solution for your problem could be that you could process the variables in your batch file and (over-)write the text file for your FTP call.
Untested (and I have no idea whether all the FTP commands are right):
*.bat
Code: Select all
@echo on
set folder=%date:~10,4%%date:~4,2%%date:~7,2%
>rel.txt (
echo OPEN release
echo MyUserName
echo MyPassword
echo lcd d:\test
echo mkdir Backup\Luna\%folder%
echo mkdir Backup\Luna\%folder%\Counter\
echo mkdir Backup\Luna\%folder%\ttp\
echo lcd D:\Servers\Counter\
echo cd mkdir Backkup\Luna\%folder%\Counter\
echo mput *.*
echo lcd C:\Program Files\Seapine\
echo mkdir Backup\Luna\%folder%\ttp\
echo mput *.*
echo binary
echo MPUT *.*
echo BYE
)
FTP -v -i -s:rel.txt
Regards
aGerman