Oooops,
I forgot to tell you important bit.
Typically we create a file that includes parameters being passed to FTP
command. So, first create a text file and pass that as parameter of FTP
command, something like:
Dim l_fso As Scripting.FileSystemObject
Dim l_ts As Scripting.TextStream
dim szCommandText as String
szCommandText = "C:\my_command_text.txt"
Set l_fso = New Scripting.FileSystemObject
Set l_ts = fso.CreateTextFile(szCommandText, True)
l_ts.WriteLine ("ftp")
l_ts.WriteLine ("ftp")
l_ts.WriteLine ("cd /mydir")
l_ts.WriteLine ("put my_ftp_file")
l_ts.WriteLine ("quit")
l_ts.Close
Shell "ftp -s:" & szCommandText & " my.server.com ", vbHide
Cheers,