Computing.Net > Forums > Programming > FTP commands in a DOS batch

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

FTP commands in a DOS batch

Reply to Message Icon

Name: Carlitos
Date: May 7, 2004 at 02:08:33 Pacific
OS: NT4
CPU/Ram: P3 128mb
Comment:

Hi,

At the moment I'm manually typing the following FTP commands into the DOS prompt:

ftp
open hostname
username
password
cd /whicheverdirectory
binary
put a:\filename or get filename

I want to write a batch that does as much as this automatically. Please help. Thanks, Carlos

Sometimes a cigar is just a cigar



Sponsored Link
Ads by Google

Response Number 1
Name: IVO
Date: May 7, 2004 at 05:30:45 Pacific
Reply:

You do not need to have a batch to do this, exploit instead the -s switch of the command as explained below.

Using a text editor, e.g. NotePad or Edit, set up a file containing your Ftp commands, so

FtpCom.txt
------------
open hostname
username
password
cd /whicheverdirectory
binary
put a:\filename

Then just type at the prompt Ftp -s:FtpCom.txt where FtpCom.txt is the name (and pathname) of the file you edited. Do not have blanks in the pathname-file name.


0
Reply to Message Icon

Related Posts

See More


requesting debug.exe tuto... Batch file to set proxy s...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: FTP commands in a DOS batch

Spilt a numeric value in dos batch file www.computing.net/answers/programming/spilt-a-numeric-value-in-dos-batch-file/19115.html

HTML and DOS Batch questiona www.computing.net/answers/programming/html-and-dos-batch-questiona/9040.html

send commands in a file, expect www.computing.net/answers/programming/send-commands-in-a-file-expect/18076.html