View Full Version : Automate batch file to accept username & Password
YogeshS
Apr 2, 2009, 07:05 AM
Hello experts
I am conneting to my ftp server through batch file.
But every time it is asking me for username & password
So how do I pass the authentification (username & Password) parameters through the batch file itself.
(I need to automate my batch file , passing the username and password in the batch file itself)so that, user doesn't have to put in the authentication every time.
Guide
Scleros
Apr 2, 2009, 11:18 PM
For the Windows command-line FTP client you can do (tested on XP, may need tweaks for other versions):
ftp -s:commandscript.txt myftpserver.mydomain.com
... and provide the commands to run in the file commandscript.txt:
MyUsername
MyPassword
Binary
Close
Quit
For other clients, see the documentation. Also note that storing passwords in a text file is a security risk. If you have administrative control of the server, using SSH SFTP/SCP is more secure.
Additional Resources:
Microsoft Windows Command-Line FTP Command List (http://www.nsftools.com/tips/MSFTP.htm)
Batch Files: Unattended FTP downloads (http://www.robvanderwoude.com/ftp.php)
Wikipedia: SSH File Transfer Protocol (http://en.wikipedia.org/wiki/SSH_file_transfer_protocol)
Wikipedia: Secure Copy (http://en.wikipedia.org/wiki/Secure_copy)
PuTTY: A free telnet/ssh client (http://www.chiark.greenend.org.uk/~sgtatham/putty/)
FileZilla: The free FTP solution (http://filezilla-project.org/)
ITeF!x: copssh - OpenSSH for Windows (http://www.itefix.no/i2/node/27) (can also be used for remote access (http://theillustratednetwork.mvps.org/Ssh/RemoteDesktopSSH.html) with public/private keys to tunnel a Remote Desktop connection via PuTTY client)