Using FTP Batch Scripts

ID: Q96269


The information in this article applies to:
  • Microsoft Windows NT operating system version 3.1
  • Microsoft Windows NT Workstation version 4.0
  • Microsoft Windows NT Server version 4.0
  • Microsoft Windows 95
  • Microsoft Windows 2000 Professional
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server


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 onto the host as a guest with the password guest, uploads the FILE1 file, and quits:
open 11.11.11.11 guest guest put file1 quit


You must use the -s option for FTP to read this file under Windows NT. If the previous script was in a file called TEST.SCR, you could start the script by typing the following:
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 auto-login, this command will fail. You would turn off auto-login with a -n in the command line. The command line would then read as follows:
ftp -n -s:test.scr 11.11.11.11

Additional query words:

Keywords : kbinterop win95 NTInterop
Version : WINDOWS:2000,95; winnt:4.0
Platform : WINDOWS winnt
Issue type : kbinfo


Last Reviewed: January 20, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.