Discussion Locked

FTP Batch File Script in Windows 2000

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to get a batch file to FTP out and copy a file on Windows 2000 Server. The batch works except for the FTP part. I looked at a few sites and I am doing what they say.
==============================
This is where the FTP plays in the main batch:

ftp -s:homiftp.txt
==============================
In that file I have:

ftp xxx.xxx.xxx.xxx
login
password
cd patch
get callanalyzer.exe
quit
==============================
When the batch file gets to that file, this is what I keep getting:

C:\>ftp -s:homiftp.txt
Error opening script file homiftp.txt.
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
==============================
I have tried variations of trying to get this to work but I keep running into that error. Any ideas on what simple bit I am missing?

Thanks.

5 replies

by lowlands

two things, make sure the file can be found, before running it, try doing a cd to the directory where the file is located.

and i think the first line of your file should say

open xxx.xxx.xxx.xxx

by borginva

Sorry but I finally figured it out. More or less. They work within a folder but not from the desktop (which is just another folder). I can not explain it but I put the files in c:\temp, take out all references of a directory from the batch and the txt file works. No idea why but that is how I got it working.
Thanks for trying, but I did not have to change anything in my txt file.

by borginva

Also, just manually typing:

ftp -s:homiftp.txt

Produces that error:

Error opening script file homiftp.txt.
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

This discussion is closed to new replies.