SunQuest
           FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 12th, 2004, 03:24 AM
maarten74 maarten74 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 maarten74 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > trouble ftp-ing through vb-scripting !


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway