FTP file from win to UNIX

hi all,
i hv written the script for file transfer when i am trying to transfer the file on windows machine only same desktop from one location to another location that is working fine but when i am trying to transfer the same to unix server it is going in infinte loop and file is also not getting transfer. And i am not able define the variable also for transferring the file pls assist on the below code :-

setlocal enabledelayedexpansion
if exist C:\Ripudaman\VCB\FTP\*.txt (goto COPYFILES) else (goto NOFILES)

:COPYFILES
for /f %%i in ('DIR /b C:\Ripudaman\VCB\FTP\*.txt') do (
echo %%i
set fn=%%i
ftp
o 172.16.2.97
finacle
7018finacle
mput $i
bye
move %%i C:\Ripudaman\VCB\FTP\bkup\.
)

echo complete

:NOFILES
echo There are no files to move

any help will be appreciated.

---------- Post updated at 06:32 AM ---------- Previous update was at 04:06 AM ----------

m waiting for reply

A reply, as requested:

Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

The UNIX and Linux Forums.

much clarification on the issue i am trying to transfer the file from windows to unix where mput is not working appropriately. i hv declare the variable i which is my files in the given directory and it is not transferring to unix system.

ftp isn't going to "eat" the lines below it. To feed lines into ftp, you'll have to feed lines into ftp. Try writing them into a file first, then ftp < input.txt

setlocal enabledelayedexpansion
if exist C:\Ripudaman\VCB\FTP\*.txt (goto COPYFILES) else (goto NOFILES)

:COPYFILES
for /f %%i in ('DIR /b C:\Ripudaman\VCB\FTP\*.txt') do (
echo %%i
set fn=%%i
ftp < open 172.16.2.97
ftp < finacle
ftp < 7018finacle
mput $i
bye
move %%i C:\Ripudaman\VCB\FTP\bkup\.
)

echo complete

:NOFILES
echo There are no files to move

this syntax is correct??

No. You forgot the 'file' part of reading from file.

Running ftp 9 times to run 9 lines isn't going to work either. It won't be the same ftp command.

echo firstline > file.txt
echo secondline >> file.txt
echo thirdline >> file.txt
ftp < file.txt