wScript.Shell Problems



I am in the process of building a script to FTP files to another
location. What i am curious to know is how can i dump what is being
sent displayed in the comand window to a text file. Here is my code.
And you will see that i am not getting anywhere.

The two variables being sent to the Function just contain FTP Commands
and the OutputFileName such as
strCMD = "PUT test.txt rmdirectory/test.txt" & vbCrLf
oFile = "C:\output.txt"

Function FTP( strCMD, oFile )
Dim objFSO
Dim strFile, objTempFldr, objFile, objRegExp
Dim objShell, WSX, ReturnCode, Output, strLog, strErrorLog
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set oFileFSO = objFSO.OpenTextFile(oFile,2,True)
set objTempFldr = objFSO.GetSpecialFolder( 2 )
strFile = objFSO.GetTempName
strFile = objTempFldr & "\" & left(strFile,Len(strFile)-4) & ".ftp"

if not objFSO.FileExists( strFile ) then objFSO.CreateTextFile(
strFile )
Set objFile = objFSO.OpenTextFile( strFile, 2, True )

objFile.WriteLine( strUser )
objFile.WriteLine( strPass )
objFile.WriteLine( Mode )

objFile.WriteLine( strCMD )
objFile.WriteLine( "bye" )
objFile.Close()


Set objShell = WScript.CreateObject("WScript.Shell")

objShell.Run "cmd /c " & COMMAND_FTP & strFile & " " & strHost,1,TRUE
set objFSO = nothing
End If

.



Relevant Pages

  • Re: wScript.Shell Problems
    ... Function FTP(strCMD, oFile) ... Dim strFile, objTempFldr, objFile, objRegExp ... Set objFSO = CreateObject ...
    (microsoft.public.scripting.vbscript)
  • ASP to Check if a file exists on an FTP server
    ... Ok I have a script that is designed to access a FTP site to GET, ... Dim isActive ... Dim strFile, objTempFldr, objFile, objRegExp ...
    (microsoft.public.inetserver.asp.db)
  • Re: nec. ports to access shared folder ?
    ... are you running nlb (multiple servers in a cluster) on that site? ... how do you get the ftp files into the wwwroot and other website ... create multiple ftp instances and point each one to one of the website ...
    (microsoft.public.windows.server.networking)
  • Re: ftp assistance requested
    ... > I have been tasked with creating some scripts to ftp files to various ... > The vendor has been no help. ... Sounds to me like the site closed normal ftp and opened secure ftp, ...
    (comp.unix.solaris)
  • Re: Need help.
    ... >I am writting a korn shell script to ftp files to another box. ... One way to do this is with a coprocess. ...
    (comp.unix.shell)