Development FTP upload batch file

Discussion in 'Software' started by fev, 31 Aug 2013.

  1. fev

    fev Industry Fallout

    Joined:
    13 Aug 2003
    Posts:
    0
    Likes Received:
    20
    Hey guys, first time in a long time that I've come crawling for help!

    Bit of background - I've started working on the development of some web frameworks that need various versions uploading to the same FTP site.

    I was trying to create a batch file that connects to the FTP then asks what to name the new folder before uploading the contents.

    The FTP will always be the same - just want it to ask for the new folder name to create then upload to.
    Bit complex?

    All help and advice welcomed!
     
  2. faugusztin

    faugusztin I *am* the guy with two left hands

    Joined:
    11 Aug 2008
    Posts:
    6,943
    Likes Received:
    268
    1) asking user for input :
    Code:
    set /p Folder="Folder on FTP Server:"
    2) create a file containing FTP commands using echo statements, where you will use the %Folder% variable in place where you are creating the new directory or changing the working directory to it.
    Code:
    echo Do this >commands.txt
    echo cd %Folder% >commands.txt
    echo Do that >commands.txt
    
    3) execute the ftp command with the file you just created using echo statements via redirection to the standard input
    Code:
    ftp -s:commands.txt ftp.server.com
     
  3. fev

    fev Industry Fallout

    Joined:
    13 Aug 2003
    Posts:
    0
    Likes Received:
    20
    amazing, thank you!
     

Share This Page