FTP Scripts on windows

January 31, 2003
misc

I found this Microsoft KB article today #96269 which shows you how to use the ftp program that comes with all versions of windows an automate a file transfer.

ftp -s:script.txt ftp.server.com
The contents of script.txt might look like this:
yourUserName
yourPassword
bin
cd /files
put file.zip
bye

This is handy for administration between servers, but keep in mind that FTP sends passwords in clear text. You should use FTP over SSL or SFTP instead.



Like this? Follow me ↯


You might also like:

36 people found this page useful, what do you think?

Comments

What if you want to run an "automated" script but still have the user enter a username and password.. in other words do no have the username and password coded in the script? Thanks
I am running a .bat file that calls an ftp server and references the commands using a .txt file. Everything is working well. My problem is when the built in windows FTP client tries to download a file from the ftp server using the get command, if the file does not exist on the server, it wipes out the file that is locally on my C: drive and leaves me with a blank file. I must always keep the field headers in this file and as such I must make sure that if there is no file on the server to leave the one locally alone. How can this be done? (Is there a way to first look to see if the file exist and only then initiate the download?) Need help - - - - - - Thanks!
When I ftp a file to my host system using a put, it defaults to record size to 80 bytes. I need this file to be 676 bytes on my host system. Can I do this using ftp?
i need to write a script download files through FTP. the script should ask password after putting password the should continue the script
ftp -s:script.txt ftp.server.com The contents of script.txt might look like this: yourUserName yourPassword bin cd /files put file.zip bye i tried thus comment nd its working,but if one pc got error,the script stops there,so can u recommend an script for exceptional handling..
i need ftp command that move the file to ftp , i used the command mput and all work (its copy the files to target) but not delete the source files. i need the command that copy and delete if the file transfer ok
To get this to work for me, my script had to look like this: open ftp.server.com user name passwd bin get filename filename bye and my ftp invocation needed the -n ftp -n -s:script.txt
Hi, I am trying to write a batch file that calls another text file with commands. My command prompt screen just keeps on scrolling when i click on the batch file. Here is what i have in batch file: ftp -s:ftpbat.txt prompt And here is what i have in ftpbat.txt open uhc51ip user name password Can anyone tell me what is the mistake i am doing here. Thanks in advance.
I'm logged onto windows machine and have to get files from a unix server. So i created my script.txt as follows:

userid
password
bin
cd /mydir
get file1
bye

..and execute the script with:
ftp -s:ftpscript.txt server1

this works fine for 1 file, but i want to get over 10,000 files all with very different names; mget prompts for Y/N response; i can't get the folder name because there are over 60,000 files in the directory and i only want 10,000;
is there a command to read the entire list of files i want to ftp from a file and ftp?
Is anyone could help, how files from one ftp site could be automatically movet to next secure ftp site in regular interval of time?
I need to upload a file from my Windows box to a remote UNIX box.The file that needs to be transferred is very big (approx 200MB) in size and the network connectivity is very poor.The issue here is as soon as I try uploading that file and hardy 30-40% of the upload is completed,the network goes down and when I start it starts uploading from the beginning again.I need a process where I can upload the file and even if the network goes,suppose the network goes down when the file has uploaded 30%,when the network comes back, it sould start from 30% instead of starting from 0%.I mean that the upload should continue from the place it stopped. Could someone please help??
I have to write a batch script which download file from ftp server(unix environment) which contain several same name

file with different modified date. Batch file should take two parameters file name and last modified date.that

script go to server and match file name according to its lastmodified date and download it to windows environment .

Please help
I have to write a batch script which download file from ftp server(unix environment) which contain several same name

file with different modified date. Batch file should take two parameters file name and last modified date.that

script go to server and match file name according to its lastmodified date and download it to windows environment .

Please help


Foundeo Inc.