Posible to use wodSFTP in .vbs? - WeOnlyDo Discussion board

Posible to use wodSFTP in .vbs? (wodSFTP / wodSFTP.NET / wodSFTPdll)

by Burma, Tuesday, February 21, 2006, 00:34 (6851 days ago)

Is there a way to use wodSFTP with .vbs (wsh) file? Either the COM or OCX I don't care. A simple example showing how to connect and write to a file would be useful.

Re: Posible to use wodSFTP in .vbs?

by wodSupport, Tuesday, February 21, 2006, 03:40 (6850 days ago) @ Burma

Yes, you can. It's important to set Blocking property to true. Here's example code:

[code]Option Explicit
Dim objFTP, lst
Set objFTP = WScript.CreateObject( WeOnlyDo.wodSFTPCom.1 , wod_ )

' please change these lines, from here
WScript.echo Please edit this file and setup Login, Hostname and Password properties
objFTP.Hostname = put.your.host
objFTP.Login = yourlogin
objFTP.Password = yourpass
' to here

objFTP.Blocking = 1
objFTP.Connect
objFTP.ListDir ( / )
lst = objFTP.ListItem
WScript.echo lst
objFTP.Disconnect

Sub wod_Connected(ErrorCode, ErrorText)
WScript.Echo Connected & ErrorText
End Sub

Sub wod_Disconnected()
WScript.Echo Disconnected
End Sub

[/code]