I have a batch file that copies a file from a FTP server to my local computer. The code is at the bottom of this post. This has been working fine for the past week. I now have decided to try running this batch file from my Access database using VBA.
I have the following code in my Access VBA module below. It executes fine & I see the DOS screen flash. However the file from the FTP server is not copied to my computer, unless I double click the batch file myself. I have tried various ShellWait functions with no luck (the code is bit above me), it just flashes the DOS screen before closing it. How can I make my code allow the batch file to finish properly & copy the needed file? Really very stuck on this one!
Dim ScriptPath As String
Dim retval As Long
ScriptPath = "G:\MyWorkFolder\Mark\FTP\
retval = Shell(ScriptPath, vbNormalFocus)
This is the code in my batch file DataBatch,
ftp -s:DataScript.scp indexftp.SomeWebsite.com
The file DataScript above contains the following code,
get fileName.csv "G:\MyWorkFolder\Mark\FTP\