Here's what I got so far but It does not work. Please help
Option Explicit
Dim objFSO, objMyFile, objShell, strFTPScriptFileName, strFile2upload1, strFile2upload2, strFile2upload3, strFile2upload4
Dim strLocalFolderName1, strLocalFolderName2, strLocalFolderName3, strLocalFolderName4, strFTPServerName, strLoginID
Dim strPassword, strFTPServerFolder
'Customize code here to fit your needs
strLocalFolderName1 = "C:\test1"
strLocalFolderName2 = "C:\test2"
strLocalFolderName3 = "C:\test3"
strLocalFolderName4 = "C:\test4"
'The following code generates the file name on the FTP server you want to copy
strFile2upload1 = "test1"
strFile2upload2 = "test2"
strFile2upload3 = "test3"
strFile2upload4 = "test4"
'The follow lines of code generate the FTP script file on the fly,
'The following code executes the FTP script. It creates a Shell
'object and run FTP program on top of it.
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))
Set objShell = Nothing
But here is what I see...
Change strLocalFolderName1 = "C:\test1"
To strLocalFolderName1 = "C:\test1\"
Change strFTPServerFolder = "Raw"
To strFTPServerFolder = "/Raw"
Change strFile2upload1 = "test1"
To strFile2upload1 = "test1.txt"
Copy is not an available command...
Change objMyFile.WriteLine ("copy" & strFile2upload1)
To objMyFile.WriteLine ("put" & strLocalFolderName1 & strFile2upload1 & " " & strFTPServerFolder)
You may need to include the filename with ftp folder
So instead you'd have:
strFTPServerFolder & "/" & strFile2upload1
If you open help in windows...
Type ftp... Hit enter
Then look at the available sub commands...
Hope this helps...
AccessGuruCarl
Programmers helping programmers
you can't find a better site.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.