Loading ...
Sorry, an error occurred while loading the content.
 

Re: [BATCH WORLD] (dos + ftp) - reading input from a txt file for ftp download

Expand Messages
  • foxidrive
    ... Use two %% in a row. ... You re welcome.
    Message 1 of 31 , Sep 14, 2010
      On 14/09/2010 23:15, Abhijat Singh wrote:
      > Hi,
      > I figured out the problem myself. I was doing "%file%" echo open<ftpproxy> where I should have been doing>>"%file%" echo open<ftpproxy>. My Bad! So its all sorted now. Thanks!
      >
      > The problem I have now is that my ftp password has a "%" and if I just script the password as is with the % intact, what I get in the script is the password without %. Hence, I am unable to connect to the server for the moment! Can you please suggest in this regard?

      Use two %% in a row.

      > Thanks very much!

      You're welcome.
    • Abhijat Singh
      Hi, I got it. Many thanks. Its feels great to interact with an expert like you. Thanks again. Kind Regards, Abhijat
      Message 31 of 31 , Sep 17, 2010
        Hi,
        I got it. Many thanks. Its feels great to interact with an expert like you.
        Thanks again.

        Kind Regards,
        Abhijat

        --- In batchworld@yahoogroups.com, foxidrive <foxidrive@...> wrote:
        >
        > On 17/09/2010 21:02, Abhijat Singh wrote:
        > > Hi,
        > > My program will have the output like this:
        > >
        > > 0001,1
        > > 3251,2
        > > 1245,3
        > > 2544,0
        >
        > Assuming your program writes the file "master_file.csv" then this should do:
        >
        >
        > @ECHO OFF
        > set "file=C:\BATCH\ftpscript2.txt"
        > del "%file%" 2>nul
        >
        > >>"%file%" echo open <ftpproxy url>
        > >>"%file%" echo user <ftpproxy user_id> <ftpproxy pswd>
        > >>"%file%" echo user <ftp user_id>@<ftp url> <ftp pswd>
        >
        > for /f "tokens=1,2 delims=," %%a in ('type "master_file.csv"') do (
        > if not %%b EQU 0 (
        > >>"%file%" echo mget %%a*
        > >>"%file%" echo mdelete %%a*
        > )
        > )
        > >> >>"%file%" echo quit
        > D:
        > cd D:\app\inbound
        >
        >
        > for /f "delims=" %%a in (
        > 'type "master_file.txt"'
        > ) do if exist "%%a" del "%%a"
        >
        >
        > ftp -v -n -i -s:"%file%"
        >
        >
        > for /f "delims=" %%a in (
        > 'type "master_file.txt"'
        > ) do if not exist "%%a" >>"file.log" echo missing %date% - %%a
        >
        >
        > C:
        > :end
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.