Hey there,
I was wondering if it is possible to have a parameter passed for the username and password for my ftp batch job.
Here is my ftp login script:
username (obviously I put my username here)
password (obviously I put my password here)
ascii
prompt y
cd Training\Export
mget 45*.*
mget 62*.*
bye
It all works fine but I have tons of these scripts doing many things and if the password changes for the ftp site, then I need to go in ALL these scripts and change the password to the new one.
Is there anyway I can have 1 txt file storing the username and password, then when the password changes, I only need to change the one file with the new password.
Thus when calling my login script, I can pass the username and password from the stored txt file.
Is this possible??
Thanks for your help in advance!!
Parameter for FTP username and password
Moderator: DosItHelp
gmazza,
This may work for you:
Use the FTP -s option for your shared login script and at the same time pass the 'real' ftp script (login sequence removed) in via input stream.
Or better try the (newly added ) batch with embedded ftp described here:
http://www.dostips.com/DtTipsFtpBatchScript.php#Batch.FtpBatchLoginSharing
and simply call:
Hope this helps.
This may work for you:
Use the FTP -s option for your shared login script and at the same time pass the 'real' ftp script (login sequence removed) in via input stream.
Code: Select all
ftp -i -s:"loginsequence.txt" <realftp1.txt
ftp -i -s:"loginsequence.txt" <realftp2.txt
...
http://www.dostips.com/DtTipsFtpBatchScript.php#Batch.FtpBatchLoginSharing
and simply call:
Code: Select all
FtpLogin.cmd realftp1.txt
FtpLogin.cmd realftp2.txt
...
Hope this helps.