I encountered the same Error:
Object required : 'MoveFile(...'
Using WinSCP 5.5.6, VBScripts "MovefileError.vbs". The scripts as below.
The Error occurred at 'Line: 20'. The file was renamed from examplefile.txt to newexamplefile.txt successfully.
' Setup session options
Dim sessionOptions
Set sessionOptions = WScript.CreateObject("WinSCP.SessionOptions")
With sessionOptions
.Protocol = Protocol_Sftp
.HostName = "xxx.xxx.com"
.UserName = "xxx"
.Password = "xxx"
.SshHostKeyFingerprint = "xxx"
End With
Dim session
Set session = WScript.CreateObject("WinSCP.Session")
' Connect
session.Open sessionOptions
Dim remotePath
remotePath = "/Usr/ftp4datalink/davis/examplefile.txt"
Dim newRemotePath
newRemotePath = "/Usr/ftp4datalink/davis/newexamplefile.txt"
session.MoveFile(remotePath,newRemotePath).Check()
' Disconnect, clean up
session.Dispose