wScript.Shell Problems
- From: "Nico VanHaaster" <nvanhaaster@xxxxxxxxxxx>
- Date: 11 Jul 2006 17:53:08 -0700
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
.
- Follow-Ups:
- Re: wScript.Shell Problems
- From: Nico VanHaaster
- Re: wScript.Shell Problems
- Prev by Date: Re: Multiple MAC Addresses to Output into an Access Table
- Next by Date: Re: Error handling bug on GetObject?
- Previous by thread: list templates in MS Word files with VBScript
- Next by thread: Re: wScript.Shell Problems
- Index(es):
Relevant Pages
|