×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Windows 2000 Batch Files ->FTP

How to use a script of FTP commands from *.bat files by Funkymatt
Posted: 20 Mar 03

From the Microsoft Site:

http://support.microsoft.com/?kbid=96269

SUMMARY
FTP (file transfer protocol) is a file transfer utility commonly used with UNIX systems.

FTP is capable of using scripts (lists of commands from external files). The following example demonstrates a script that opens a connection to IP address 11.11.11.11, logs on to the host as a guest with the password "guest," uploads the File1 file, and then quits:
open 11.11.11.11
user
guest
guest
put file1
quit

MORE INFORMATION
You must use the -s option for FTP to read this file under Windows. If the previous script was in a file called Test.scr, you can start the script by typing:
ftp -s:test.scr

You can specify the host name in the command line and then use the script to process the login. For example, if you use the following command line
ftp -s:test.scr 11.11.11.11

the script file should read as follows:
user
guest
guest
put file1
quit

However, if the FTP host implements automatic login, this command will not work. To turn off automatic login, use the -n switch in the command line as follows:
ftp -n -s:test.scr 11.11.11.11

Back to Microsoft: Windows FAQ Index
Back to Microsoft: Windows Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close