Computing.Net > Forums > Programming > FTP and Batch Files

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 and Batch Files

Reply to Message Icon

Name: Ferroli_IT
Date: August 8, 2005 at 09:04:23 Pacific
OS: Win XP SP2
CPU/Ram: 3GHz and 1GB
Comment:

Hi,
I am trying to automate a series of FTP commands so that i can hand a job over to someone not technically minded! These are the FTP commands I am currently using:

ftp 100.100.100.100
username
password
cd folder1/folder2
binary
put c:\temp\Test.txt
quit

This succesfully transfers the test file but on splitting it into a batch file and FTP script the logon just goes into a loop.

Batch file:

ftp -n -s:FTP.txt 100.100.100.100

FTP.txt:

username
password
cd folder1/folder2/
binary
put c:\temp\test.txt
quit

Any help would be appreciated.
Cheers.

"Whats wrong with the cat?" - Mrs Schrödinger


"Whats wrong with the cat?" - Mrs Schrödinger



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 8, 2005 at 10:42:19 Pacific
Reply:

Try this bat:

:==
@echo off

> ft.do echo o 100.100.100.100
>> ft.do echo username
>> ft.do echo password
>> ft.do echo bin
>> ft.do echo cd somedir
>> ft.do echo put somefile.txt
>> ft.do echo bye

ftp -s:ft.do
::==

M2


If at first you don't succeed, you're about average.


0

Response Number 2
Name: Ferroli_IT
Date: August 9, 2005 at 01:09:53 Pacific
Reply:

Thanks M2 but I'm still getting the same problem. If I run the script it creates a temp file called ft.do and opens a command window but that's it!

If I remove all of echo references I can see that the logon seems to have gone into some sort of loop again.

Any ideas?

"Whats wrong with the cat?" - Mrs Schrödinger


0

Response Number 3
Name: Mechanix2Go
Date: August 9, 2005 at 06:22:00 Pacific
Reply:

I usually run it from a CMD prompt, but just for drill I tried clicking on it.

Works OK.

Beats me why yours doesn't.

M2


If at first you don't succeed, you're about average.


0

Response Number 4
Name: Ferroli_IT
Date: August 9, 2005 at 07:02:13 Pacific
Reply:

Thanks for all your help M2,
I'm guessing that it is just a problem with the network settings ...or the firewall ...or with windows in general. I can feel lots of testing coming on.

Cheers

"Whats wrong with the cat?" - Mrs Schrödinger


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Generate list of network ... programmer's editor



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 and Batch Files

FTP DOS Batch File www.computing.net/answers/programming/ftp-dos-batch-file/15347.html

FTP Download Batch File ( BAT ) www.computing.net/answers/programming/ftp-download-batch-file-bat-/15790.html

HTML and batch files www.computing.net/answers/programming/html-and-batch-files/2014.html