Results 1 to 3 of 3

Thread: VBSFTP

  1. #1
    Join Date
    Dec 1969

    Default VBSFTP

    Hello<BR>I have the following question. I am trying to call text file "OrdersFtp.txt" has FTP code send text file from NT to mainframe by using the following code, but it is not working. The text file I am calling has the code open server, login Id, password and the code to send the data . It works fine from ftp&#062; command ... but that is not the way we need to run.<BR>Here the code I am using from VBS:-<BR><BR> set oShell = createobject("Wscript.shell")<BR> oShell.Run("ftp -s:""C:OrdersFtpT.txt""")<BR><BR>Any help will be appreciated<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: VBSFTP

    why not use the FTP component from www.serverobjects.com ? it is, after all, free and far easier to use than messing around with the command-line<BR><BR><BR>j<BR>htp://rtfm.atrax.co.uk/

  3. #3
    Join Date
    Dec 1969

    Default If you are saying the

    "OrdersFTP.txt" has code like this<BR><BR> user yourFTPid yourFTPpassword <BR><BR> get somefile newpath
    ewfilename<BR> etc..<BR><BR>then think how you would use that from a command-line. You would use standard input "&#060;" like this<BR><BR> ftp -nv yourFTPipaddress &#060; c:OrdersFTPT.txt<BR><BR>So your run command should look something like<BR><BR> oShell.Run("ftp -nv yourFTPipaddress &#060; c:OrdersFTPT.txt")<BR><BR>Now if you really want to simplify things create yourself a file called "OrdersFTPT.bat" with your FTP command:<BR><BR> ftp -nv yourFTPipaddress &#060; c:OrdersFTPT.txt<BR><BR>So now simply execute your .bat file<BR><BR> oShell.Run("OrdersFTPT.bat")<BR><BR>Does that make sense? ; )<BR><BR>This gives a lot more flexibility. Let&#039;s say you wanted to create yourself a log file of all the FTP commands so you can see if something was successful. All you need to do is modify the .bat file like this<BR><BR>ftp -nv yourFTPaddress &#060; c:OrdersFTPT.txt &#062; c:OrdersFTPT.log <BR><BR>This will redirect all the FTP "responses" you normally would see on the screen to a file called "OrdersFTPT.log".<BR><BR>One last thing, make sure that you have the proper permissions to write to whatever folder you are putting those files (i.e. - c:). Think about which user the .bat script is really running under too (hint..hint). ; )<BR><BR>Hope that helps and IMHO this is pretty simple.<BR><BR>Pete<BR><BR>

Posting Permissions

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