|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
trouble ftp-ing through vb-scripting !
Hi there, i just joined this forum and would like to start with a problem i have while trying to ftp some files using vb-scripting.
I developed the following code in which i don't get syntax or runtime errors. The code gets until the line WScript.Echo "Putting file: " & oFile i can see this output on my screen) After that the code seems to be stuck, cause nothing happens anymore. None of the files was ftp-ed to it's destination. Does Anyone know what i'm doing wrong here ? Thanks. Dim oFS, OutputDir, Ifso, Ifile, oExec, TempDir, ResponseFile, WshShell TempDir = "C:\tmp\" ResponseFile = "response.ftp" Server = "[ip-address of my server]" Set WshShell = CreateObject("WScript.Shell") Set oFS = CreateObject("Scripting.FileSystemObject") Set OutputDir = oFS.GetFolder("C:\tmp\") For Each oFile In OutputDir.Files If ucase(Right(oFile.name,3)) = "CSV" and oFile.size > 0 Then Set Ifso = CreateObject("Scripting.FileSystemObject") Set Ifile = Ifso.CreateTextFile( TempDir & ResponseFile, 2, true ) Ifile.WriteLine ("verbose off") Ifile.WriteLine ("user [username] [password]") Ifile.WriteLine ("bin") Ifile.WriteLine ("put " & oFile) Ifile.WriteLine ("quit") Ifile.Close WScript.Echo "Putting file: " & oFile Set oExec = WshShell.Exec("ftp -n -s:" & TempDir & ResponseFile & " " & Server) Do While oExec.Status <> 1 WScript.Sleep 100 Loop End If Next |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > trouble ftp-ing through vb-scripting ! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|