ftp/Simple.vbs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | '/////////////////////////////////////////////////////////////////////////////////// '// '// Simple '// '// Purpose: '// Connects to remote server. '// '/////////////////////////////////////////////////////////////////////////////////// Dim obj Set obj = CreateObject( "sfFTPLib.FTPConnectionSTA" ) Dim result ' Settings obj.Host = "smartftp.com" obj.Username = "anonymous" obj.Password = "test@test.com" obj.Port = 21 obj.Protocol = 0 ' ftpProtocolNormal obj.Passive = 1 obj.MLST = 1 ' Enable logging 'Dim fileLogger 'Set fileLogger = obj.SetFileLogger() 'fileLogger.File = "Connect.log" WScript.Echo "Port = " & obj.Port & vbCrLf obj.Connect() WScript.Echo "Connected" & vbCrLf ' Disconnect obj.Disconnect() WScript.Echo "Disconnected" & vbCrLf |