• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 478
  • Last Modified:

Ftp Batch Command Repeats Endlessly

The command in my ftp batch file repeats endlessly, and I have to hit Ctrl-C to make it stop. This does not happen when I type directly into windows command prompt. My batch script has one line:

ftp -s:mybatch.txt ftp.mysite.com
0
timothyausten
Asked:
timothyausten
  • 4
  • 3
1 Solution
 
Steve KnightIT ConsultancyCommented:
TRy putting

open ftp.mysite.com as the first line in your script file.  the rest should then be

open ftp.mysite.com
username
password
bin
chdir /sdsdkldklsd
get sdjsdkjsdk
put sdlldslds
quit

with your selection of gets & put's of course.

hth

Steve
0
 
Steve KnightIT ConsultancyCommented:
(and take the ftp.mysite.com off the command line I mean)
0
 
timothyaustenAuthor Commented:
no good. i have to open the ftp program first, then use ftp commands such as "open ftp.mysite.com." the problem seems to start when i trying to open ftp from a batch file. for example, if i have the single command "ftp" in my batch file, i get something like this in my command prompt screen:

c:\documents and settings\tim\my documents\webstie\ftp

c:\documents and settings\tim\my documents\webstie\ftp

c:\documents and settings\tim\my documents\webstie\ftp

c:\documents and settings\tim\my documents\webstie\ftp

          ..................... add infinitem.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
timothyaustenAuthor Commented:
............ok, this is interesting. if the first command in the batch file is "ftp.exe" rather than just "ftp" it works. i just don't know why it has to be that way for me and not for anybody else, and that is frustrating.  >:/
0
 
Steve KnightIT ConsultancyCommented:
Is your batch file called ftp too by any chance and therefore would be re-run?  I'd do a search for ftp.* on you hard drive (at least in the path) if not maybe you have an old script.

I always prefer to put all the commands in the script and leave the ftpserver off the commandline but it was only a thought.

Steve
0
 
timothyaustenAuthor Commented:
steve-  despite your explicit advice i still managed to misunderstand you. i thought that you meant that i should start the batch file with "open ftp.mysite.com," rather than the script file. sorry about that.

anyway, i had a few different file names that started with ftp, and i changed them.................and guess what, it worked! i took the ftpserver off the commandline, and consolidated the script file into the batch file using the line "ftp -s:%0." now i only have one file to doubleclick, and it's a pretty nice way to keep my website updated :)

ftp -s:%0
goto done
open ftp.mysite.com
myusername
mypassword
binary
prompt
mput *.*
bye
:done
0
 
Steve KnightIT ConsultancyCommented:
Glad to hear it - ingenious solution putting the ftp script in the same file as of course ftp just ignores the first two batch commands so you get a few errors but it works -- thanks for the points.

Steve
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now