Computing.Net > Forums > Windows Server 2003 > FTP in a batch file

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 in a batch file

Reply to Message Icon

Name: gerryvr
Date: January 25, 2008 at 13:04:47 Pacific
OS: Windows 2003
CPU/Ram: 3GHz/2GB
Product: Dell
Comment:

I need to automatically ftp from my server to a different one (serverB). I get path errors every time I try. These batch files are located in c:\bats on my server. I can manually ftp the file, so I know the connection works.

The text of my ftpserverB.bat is:
start ftp -s:fileX.txt 123.45.678.90

The text of my fileX.txt is:
loginname
password
put d:\...(path to file to be transferred)
bye

Any ideas? Thanks.



Sponsored Link
Ads by Google

Response Number 1
Name: jefro
Date: January 25, 2008 at 14:29:34 Pacific
Reply:

I think you need to use something like "say".

I read it wrong and answer it wrong too. So get off my case you peanut.


0

Response Number 2
Name: seikan
Date: January 27, 2008 at 17:13:21 Pacific
Reply:

Dear gerryvr,

Try the following -

ftpserverB.bat:
ftp -s:FileX.txt

FileX.txt:
open 123.45.678.90
loginname
password
lcd *path to file to be transferred*
cd *optional path to destination if required*
put *file*
bye

Hopefully this may be of some help to you.

All the best,
Jonathan


0

Response Number 3
Name: gerryvr
Date: January 28, 2008 at 10:35:41 Pacific
Reply:

Thanks to both of you, but still no luck. I did find a clue. I used Wordpad to write the batch files, and was always viewing them in Wordpad. Well, I dug deep for my old edlin commands and viewed the files at the command prompt. Both files had what looked like formatting codes embedded
in them. I wrote two new files using Notepad, and they view without the
formatting codes.

I still have had no luck in automating that file send. I don't get the same path errors as before, but the command window zips by and closes so fast that I cannot read what's happening. Do you know the switch/command to make that file run one line at a time?
Gerry


0

Response Number 4
Name: lwcomputing
Date: January 29, 2008 at 00:57:07 Pacific
Reply:

johnathan's should work.

What are your errors when you use his (note- on his, skip the the "open" line as you're doing that in the command.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows Server 2003 Forum Home


Sponsored links

Ads by Google


Results for: FTP in a batch file

Netstat in Windows Batch script www.computing.net/answers/windows-2003/netstat-in-windows-batch-script/7224.html

Move only 1 file from a multiple-filed folder www.computing.net/answers/windows-2003/move-only-1-file-from-a-multiplefiled-folder/9337.html

Batch file to check a file in Unix www.computing.net/answers/windows-2003/batch-file-to-check-a-file-in-unix-/6057.html