Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am having following requirement.
1. Want to create Batch file which contains the details to open FTP server like.
FTP> open TestDev
User xxxx
Password xxx
Copy command to copy file from localFilePath to FTPServerPath.
2. In the batch file i want to pass the 'localFilePath' as an parameter.
I can easily pass the parameter in ordinary bat file using '%1' kinds of operator but how to do it incase of FTP, i don't know.
Please help me it is urgent

Thanks,
Devesh Kumar
Posted

MSDN is your friend: Using FTP Batch scripts, MSDN[^]
 
Share this answer
 
Hi,

Thanks for this artical, i have logged in FTp server successfully using bat fielw which contains following item.

open FTPServer
user
guest
guest
cd %1


but i am getting error the invalid cd %1 command. it is not taking the parameter which i am passing it.
c:\>ftp -n -s:Test.bat Data\Archive

'Data\Archive' is the directory on FTPServer machine.

Please help me how to pass parameter in the FTP batch file.

Thanks,
Devesh Kumar
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900