1.

Solve : Run ftp command using bat file.?

Answer»

I write a bat file to ftp to a server & copy some files to another location using GET COMMAND. For example I want to get this file ABCddmmyy.txt. ABCD part of the file should be fix & only the ddmmyy.txt part is a variable. SAMPLE of what I want is as follows.

ftp get ABCDddmmyy.txt

My codes are as follows.

@echo off
echo Date: %Day% Time: %time%
echo. Loading ......
h:
CD testapp1

ftp -s:i:\scdev.bin

SCDEV.bin file is as follow

open ultestapp1
user
password
bye



Well...keep all your file information as a variable, as well as what command
you want.

Set c1=FIRST COMMAND
Set c2=SECOND COMMAND
...
echo %c1% > ftplogin.txt
echo %c2% >> ftplogin.txt
echo %c3% >> ftplogin.txt
echo %c4%(this would be the GET command) >> ftplogin.txt
echo %c5% >> ftplogin.txt


You have to modify it to suit your needs, but it will WORK. Quote from: Helpmeh on October 16, 2009, 04:30:12 AM

Well...keep all your file information as a variable, as well as what command
you want.

Set c1=FIRST COMMAND
Set c2=SECOND COMMAND
...
echo %c1% > ftplogin.txt
echo %c2% >> ftplogin.txt
echo %c3% >> ftplogin.txt
echo %c4%(this would be the GET command) >> ftplogin.txt
echo %c5% >> ftplogin.txt


You have to modify it to suit your needs, but it will work.


Thanks about your help

But still It's not what I want & I am a beginner to this. So please give me a complete codes. I change my post. I think now you can understand what I want. In my remaining codes it derectly goes upto to ftp prompt. But I want get ABDC part also typed on ftp prompt once I run the bat. I only want to change the DDMMYY.txt part.


Discussion

No Comment Found