Thanks, it works also in scripting version of Visual Basic now.
- usa
SynchronizeDirectories
is fixed already in the latest beta/RC version.
Imports System
Imports WinSCP
Module Module1
Sub Main()
Dim sessionOptions As SessionOptions
Dim session As Session
sessionOptions = CreateObject("WinSCP.SessionOptions")
sessionOptions.Protocol = Protocol.Ftp
sessionOptions.FtpSecure = FtpSecure.Implicit
sessionOptions.HostName = "***"
sessionOptions.UserName = "***"
sessionOptions.Password = "***"
session = CreateObject("WinSCP.Session")
session.Open(sessionOptions)
session.SynchronizeDirectories(SynchronizationMode.Local, "***", "***", False)
End Sub
End Module
Option Explicit
Sub Main()
Dim sessionOptions As sessionOptions
Dim session As session
Set sessionOptions = CreateObject("WinSCP.sessionOptions")
sessionOptions.Protocol = Protocol_Ftp
sessionOptions.FtpSecure = FtpSecure_Implicit
sessionOptions.HostName = "***"
sessionOptions.UserName = "***"
sessionOptions.Password = "***"
Set session = CreateObject("WinSCP.Session")
session.Open sessionOptions
session.SynchronizeDirectories SynchronizationMode_Local, "***", "***", False
End Sub
Option Explicit
Sub Main()
Dim sessionOptions ' <-- !!! Removed type declaration
Dim session As session
Set sessionOptions = CreateObject("WinSCP.sessionOptions")
sessionOptions.Protocol = Protocol_Ftp
sessionOptions.FtpSecure = FtpSecure_Implicit
sessionOptions.HostName = "***"
sessionOptions.UserName = "***"
sessionOptions.Password = "***"
Set session = CreateObject("WinSCP.Session")
session.Open sessionOptions
session.SynchronizeDirectories SynchronizationMode_Local, "***", "***", False
End Sub
Invalid procedure call or argument
session.Open sessionOptions
Option Explicit
Sub Main()
Dim sessionOptions As sessionOptions
Dim session ' <-- !!! Removed type declaration
Set sessionOptions = CreateObject("WinSCP.sessionOptions")
sessionOptions.Protocol = Protocol_Ftp
sessionOptions.FtpSecure = FtpSecure_Implicit
sessionOptions.HostName = "***"
sessionOptions.UserName = "***"
sessionOptions.Password = "***"
Set session = CreateObject("WinSCP.Session")
session.Open sessionOptions
session.SynchronizeDirectories SynchronizationMode_Local, "***", "***", False
End Sub
Object doesn't support this property or method
session.SynchronizeDirectories SynchronizationMode_Local, "***", "***", False
<job>
<reference object="WinSCP.Session" />
<script language="VBScript">
Option Explicit
Dim sessionOptions
Dim session
Set sessionOptions = CreateObject("WinSCP.SessionOptions")
sessionOptions.Protocol = Protocol_Ftp
sessionOptions.FtpSecure = FtpSecure_Implicit
sessionOptions.HostName = "***"
sessionOptions.UserName = "***"
sessionOptions.Password = "***"
Set session = CreateObject("WinSCP.Session")
session.Open sessionOptions
session.SynchronizeDirectories SynchronizationMode_Local, "***", "***", False
</script>
</job>
Module1.wsf(19, 10) Microsoft VBScript runtime error: Object doesn't support this property or method: 'SynchronizeDirectories'