ftp batch file input variable - help

November 23, 2010 at 19:28:27
Specs: Windows 2003
i have been trying to get input parameters to work but with no success.

i need to ftp a file, i have this setup going

a cmd file called CallFtpBatchFile.cmd that calls a text file to ftp the file

below is the content of the cmd file

ftp -n -s:c:\Source\ftp\ftp.txt

the ftp.txt has these lines of code

open ip address
user username password
put C:\Source\FTP\new\test.txt upload\123456\test.txt


the above setup works, but is there a way to pass in the filename that i want to ftp? so instead of put C:\Source\FTP\new\test.txt upload\123456\test.txt, it would be put C:\Source\FTP\new\Filename.txt upload\123456\Filename.txt

thank you

See More: ftp batch file input variable - help

Report •

November 24, 2010 at 12:35:56
@echo off > #.ftp & setLocal enableDELAYedeXpansion

set /p F=file name?

>> #.ftp echo o mysite
>> #.ftp echo user
>> #.ftp echo pass
>> #.ftp echo bin
>> #.ftp echo put !F!
>> #.ftp echo bye

ftp -s:#.ftp

Life is too important to be taken seriously.


Report •
Related Solutions

Ask Question