I've a batch file that is opening a FTP connection to a server and putting a file on a specified location.
Here is how my ftpConnection.bat file look like..
open HOST FTP_USER_NAME FTP_USER_PASSWD cd TO_DIR lcd TO_FILE_LOCATION put THE_FILE quit and from command prompt if i run it like this ftp -i -s:ftpConnection.bat it works fine.
My requirement is to pass HOST, USER_NAME and PASSWORD as argument
so i tried to use %1 %2 and %3 but this is not working for me.
Passing the argument like this
C:\Users\xxx\Desktop>ftp -i -s:ftpConnection.bat "HOST" "USER_NAME" "PASSWORD" also tried without the quotes but result is same, it'S showing
Transfers files to and from a computer running an FTP server service (sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuf fer] [-b:asyncbuffers] [-w:windowsize] [host]
Followed and tried few document like How to pass multiple parameters in CMD to batch file and Batch file command line arguments
they suggested to use set and i tried it like below but result is same.
set host=%1 set uname=%2 set passwd=%3 open %1 %2 %3 Can anyone suggest me what i am doing wrong or any pointer to achieve this.
Thanks in advance.