Actual batch
Code: Select all
@echo off
setlocal EnableDelayedExpansion
set /p "data="<"%QUADIR%QUA_tmp_datatest_vtest.txt" >nul
ren "%QUADIR%QUA_tmp_datatest_vtest.txt" "FSeq_002_IN_%data:~20,8%_%data:~34,2%%data:~32,2%%data:~28,4%.dat"
@ftp -i -s:"%~f0"&GOTO:EOF
open MY_SERVER
Username
Password
!:--- FTP commands below here ---
cd /usr/wtest/geq/files/IN/
binary
mput FSeq_002_IN_*.dat
disconnect
bye
Questions
1 - The server name, user/ password, directory to put file should be passed to ftp as parameter,i've tried to create the variables before starting the ftp, but within the ftp values appear to null
2 - The name of the file to send is created as rename the file based on the 1st line of the file, how to pass the new name of file into the ftp?
Thank's in advance for your help.