We help IT Professionals succeed at work.

Batch file to copy from FTP site

mtech
mtech asked
on
Medium Priority
794 Views
Last Modified: 2012-05-06
We have a number of remote users on laptops and I want to be able to give them a batch file that will copy 4 files (the content of one folder) from our FTP site to a folder on their laptops. Laptops all run XP Pro and use 3G dialup to access our servers.

Any suggestions of the best way to do this - installing any software is out as the logistics of getting hold of 400 laptops ....
Comment
Watch Question

Senior Engineer
CERTIFIED EXPERT
Top Expert 2010
Commented:
Put the ftp commands in a text file:

MyUsername
myPassword
hash
bin
lcd c:\test
cd /pub
mget *
quit



Then call FTP with "ftp -i -s:test.txt"

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
do what tgerbert  says... but add the server name while calling the FTP command like below
 "ftp -i -s:test.txt <servername>"
Praveen DMInfra Team Lead
CERTIFIED EXPERT
Top Expert 2008

Commented:
save the file as a -  ftp.bat

-----
V@echo off

> %0.ftp echo o mysite.com
>> %0.ftp echo username
>> %0.ftp echo password
>> %0.ftp echo bin
>> %0.ftp echo cd mydir
>> %0.ftp echo prompt
>> %0.ftp echo mget filename.ext
>> %0.ftp echo bye
ftp -s:%0.ftp
-----

Enter the details in above lines and save the file and give a try....

Author

Commented:
Thanks guys
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.