• FTP using Batch or vbs file

    Home » Forums » AskWoody support » Windows » Windows – other » FTP using Batch or vbs file

    Author
    Topic
    #408456

    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.

    Viewing 3 reply threads
    Author
    Replies
    • #862585

      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.

    • #862586

      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.

      • #862603

        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.

        • #862613

          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.

        • #862614

          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.

          • #862617

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

            • #862665

              The command line we use is:
              “c:program filesws_ftpftp95pro.exe” local:X:MLXCATALOGREPORTDAILY.ZIP Anacomp:DAILY.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.

            • #862666

              The command line we use is:
              “c:program filesws_ftpftp95pro.exe” local:X:MLXCATALOGREPORTDAILY.ZIP Anacomp:DAILY.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.

          • #862618

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

        • #862623

          The post that jscher2000 was referring to is probably post 380784

          • #862627

            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?

            • #862651

              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.

            • #862652

              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.

          • #862628

            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?

          • #862655

            Exactly. The .txt file contains what the user would otherwise have to type to operate the command line FTP program. smile

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

          • #862656

            Exactly. The .txt file contains what the user would otherwise have to type to operate the command line FTP program. smile

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

        • #862624

          The post that jscher2000 was referring to is probably post 380784

      • #862604

        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.

    • #862806

      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

    • #862807

      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

    Viewing 3 reply threads
    Reply To: FTP using Batch or vbs file

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: