Results 1 to 11 of 11
  1. #1
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    FTP using Batch or vbs file

    I am trying to automate some work that is being done by a co-worker of mine. He spends a lot of time manually FTPing data to and from. I'm sure that this can more easily be done through a batch file or .vbs script. Does anyone have any example code for accomplishing this? If possible, I'd like to see examples of both.

    Thanks.

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: FTP using Batch or vbs file

    Windows XP has a command line FTP program that can act on a text file listing commands. I have used this to upload dozens of files to a remote server. Occasionally it bombs out, so I don't recommend it for unattended operation. I posted on this in the past but have to run this minute. If you don't find it, please let me know.

  3. #3
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP using Batch or vbs file

    I tried to search for past posts prior to posting my own, and didn't find anything.

    I am aware that WinXP has its own command-line FTP engine. I've used it many times. However, when I've tried to write a batch file to automate it, I get the FTP session up, but the user and pwd commands are not processed. Apparently, I'm doing something wrong, because I know that it can be done within a text file.

  4. #4
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Juneau, Alaska, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP using Batch or vbs file

    When I did it using WS_FTP I had to put the login & password in the site profile-then I could invoke FTP from the command line with the site profile & from/to file destinations as arguments.

  5. #5
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP using Batch or vbs file

    Could you provide some more information on this. We use WS_FTP already.

  6. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: FTP using Batch or vbs file

    The post that jscher2000 was referring to is probably <post#=380784>post 380784</post#>

  7. #7
    2 Star Lounger
    Join Date
    Feb 2010
    Location
    Denver, CO
    Posts
    191
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP using Batch or vbs file

    I believe that I found a fairly good primer for FTP batch files here. This think this was written for AS/400 programmers, but it is a good article for anyone. Thanks to those who responded.

    Now, does anyone have a good vbs script?

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: FTP using Batch or vbs file

    A good VBS script to do what? Do you want to take advantage of the command-line FTP program or some other package? If you purchase an ActiveX (COM) control such as the one in IP*Works from nsoftware (or maybe a free one out there somewhere) you can script it directly without having to try to hack at other programs.

  9. #9
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: FTP using Batch or vbs file

    Exactly. The .txt file contains what the user would otherwise have to type to operate the command line FTP program. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    The batch file contains the command line that runs the FTP program and feeds it the .txt file.

  10. #10
    2 Star Lounger
    Join Date
    Sep 2003
    Location
    Juneau, Alaska, USA
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: FTP using Batch or vbs file

    The command line we use is:
    "crogram filesws_ftpftp95pro.exe" local:X:MLXCATALOGREPORTDAILY.ZIP AnacompAILY.ZIP

    Can't remember right now how we set up the Anacomp profile-it's not on my machine. I'll look in a bit when I'm at the machine that has it.

  11. #11
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: FTP using Batch or vbs file

    Randall

    The main problem with automating FTP is that is produced nothing in the way of errorlevels to assist you.

    I wrote something to download antivirus updates from the Network Associates' website, and you may be able to glean some information from the file (which I've attached as a TXT file).

    Since I seem to write BATch files for a living (but only up to 19 october, mind!), I'll help further if I can!

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •