EXECUTE PROCESS TASK - FTP Files via .CMD File

  • I have some DTS packages that manipulate data and export 3 files into a drive.  I am trying to use EXECUTE PROCESS TASK at the SUCESSFULL completion of these packages to FTP these files, but the Move_MyFiles.cmd hangs after the FTP line in the following file:

    cd w:

    ftp

    open ThisFTPSite ThisPort

    user MyUserName MyPassWord

    bin

    put File1

    put File2

    put File3

    bye

    This works fine via the CMD prompt, thus I thought it would work by simply copying it to a .CMD file but no luck.  If I run this via a CMD prompt, i.e. Move_MyFiles.cmd, it hangs at ftp> without running the next line: open ThisFTPSite ThisPort.

    I am assuming I need to run the FTP command with the OPEN and USERNAME and PASSWORD together but don't know how.

    Any assistance will be greatly appreciated.

  • You need to code the cmd file to something like this:

    echo open ThisFTPSite ThisPort> Tempfile

    echo MyUserName>> Tempfile

    echo MyPassWord>> Tempfile

    echo bin>> Tempfile

    echo put File1>> Tempfile

    echo put File2>> Tempfile

    echo put File3>> Tempfile

    echo bye>> Tempfile

    ftp -s:Tempfile

  • Thanks!  That's it!

  • Even better.

    Use the custom DTS FTP task from SQLDTS,

    http://www.sqldts.com/default.aspx?302

    Unlike the standard FTP task, this one allows sending and receiving of files instead of fiddling around with external .CMD files.

    --------------------
    Colt 45 - the original point and click interface

  • Thanks for the article!  Good stuff!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply