Hello ..
The script returns "Success" for me as well.
Do you call the LoadLicenseKeyFile or LoadLicenseKeyData before you call the Connect function?
Please post the script where the Connect() calls returns 17.
Do you have latest version of the FTP Library installed?
BTW: Please do not post your complete license key.
Regards,
-Mat
Mat,
I do not call LoadLicenseKeyData before I call Connect. I assumed the license info was loaded into the registry or some other permanent store. Is this not the case?
Below is my script that fails.
If I call the License method prior to the connect method will it work?
This script was working using the 30 day aval license.
Peter
Connect Script:
'///////////////////////////////////////////////////////////////////////////////////
'//
'// 2007 © Unisys Marysville Data Centre
'//
'// Purpose:
'// Connects to remote DPS server.
'//
'//
'//
'///////////////////////////////////////////////////////////////////////////////////
Dim obj
Set obj = CreateObject("sfFTPLib.FTPConnectionSTA")
' "Object created." & vbCrLf
set shell = WScript.CreateObject( "WScript.Shell" )
datafile = shell.ExpandEnvironmentStrings("%DATAFILE%")
filename = shell.ExpandEnvironmentStrings("%FILENAME%")
appgrp= shell.ExpandEnvironmentStrings("%APPGRP%")
Dim fso, tf
Set fso = CreateObject("Scripting.FileSystemObject")
Set tf = fso.CreateTextFile("FtpLogtxt.txt", True)
tf.WriteLine("Begin vbs.")
Dim result
tf.WriteLine( " pcfile=" & datafile & ", destfilename=" & filename & ", appgrp=" & appgrp )
' Settings
If "PROD" = appgrp Then
obj.Host = "142.139.*.*"
obj.Username = "****"
obj.Password = "*****"
path= "/MV/Diesel"
Else
obj.Host = "142.139.*.*"
obj.Username = "****"
obj.Password = "*****"
path = "/mv/unisys"
End if
obj.Port = 21
obj.Protocol = 2 ' 2 = ftpProtocolSSLExplicit
obj.Passive = 0 ' DPS says no Passive
obj.MLST = 1
' Enable logging
obj.LogFile = "Connect.log"
tf.WriteLine( "Port = " & obj.Port & vbCrLf )
' Connect
result = obj.Connect()
tf.WriteLine("Connected. result=" & result & vbCrLf )
If result <> 0 Then
strMsg = "connect failed. " & "LastReplyCode = " & obj.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & obj.LastReply & vbCrLf
tf.WriteLine( strMsg )
End If
If obj.ChangeDirectory( path ) = 0 Then
tf.WriteLine("ChangeDirectory() successful.")
' Upload File
Dim nRestartLo : nRestartLo = 0
Dim nRestartHi : nRestartHi = 0
Dim strMsg
If obj.UploadFile(datafile, filename, nRestartLo, nRestartHi) = 0 Then
strMsg = "UploadFile() successful." & vbCrLf
strMsg = strMsg & "LastTransferBytes = " & obj.LastTransferBytesLo & " B" & vbCrLf
strMsg = strMsg & "LastTransferTime = " & obj.LastTransferTime & " s" & vbCrLf
strMsg = strMsg & "LastTransferSpeed = " & obj.LastTransferSpeed & " B/s"
tf.WriteLine( strMsg )
Else
strMsg = "UploadFile() failed. LastError = " & obj.LastError & vbCrLf
strMsg = strMsg & "LastReplyCode = " & obj.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & obj.LastReply & vbCrLf
tf.WriteLine( strMsg )
End If
Else
strMsg = "CD failed. " & "LastReplyCode = " & obj.LastReplyCode & vbCrLf
strMsg = strMsg & "LastReply = " & obj.LastReply & vbCrLf
tf.WriteLine( strMsg )
End If
tf.Close