Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Run ftp command using bat file.  (Read 3654 times)

0 Members and 1 Guest are viewing this topic.

renuka

    Topic Starter


    Newbie

    Run ftp command using bat file.
    « on: October 16, 2009, 03:46:24 AM »
    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



    « Last Edit: October 18, 2009, 04:30:09 AM by renuka »

    Helpmeh



      Guru

    • Roar.
    • Thanked: 123
      • Yes
      • Yes
    • Computer: Specs
    • Experience: Familiar
    • OS: Windows 8
    Re: Run ftp command using bat file.
    « Reply #1 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.
    Where's MagicSpeed?
    Quote from: 'matt'
    He's playing a game called IRL. Great graphics, *censored* gameplay.

    renuka

      Topic Starter


      Newbie

      Re: Run ftp command using bat file.
      « Reply #2 on: October 18, 2009, 04:37:46 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.