You are currently offline, waiting for your internet to reconnect

Using FTP Batch Scripts

Support for Windows XP has ended

Microsoft ended support for Windows XP on April 8, 2014. This change has affected your software updates and security options. Learn what this means for you and how to stay protected.

This article was previously published under Q96269
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
Properties

Article ID: 96269 - Last Review: 09/11/2011 06:45:00 - Revision: 5.0

  • Microsoft Windows XP Professional
  • Microsoft Windows XP Home Edition
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional Edition
  • Microsoft Windows NT Server 4.0 Standard Edition
  • Microsoft Windows NT Workstation 3.1
  • Microsoft Windows NT Workstation 4.0 Developer Edition
  • Microsoft Windows 95
  • kbinfo kbinterop KB96269
Feedback