G
George A
I'm trying to send a file via ftp.exe, and then read the
log file generated by that command. The problem is that
my program continues after I've shell to ftp, and does not
wait until ftp is finished; my log file is incomplete.
I tried a loop (shown below) to wait until the log file is
present, but the file is apparently cataloged before it is
complete.
Any help you can offer is greatly appreciated.
Thanks
George
PS: I am open to any solution. (I'm not tied to this
direction).
Function ftp_Shell()
strKeyFile = "C:\MyKeys.txt"
strLogFile = "C:\MyLog.prn"
strShellCommand = Replace("%comspec% /c ftp.exe -s:|" &
strKeyFile & "| >|" & strLogFile & "|", "|", Chr(34))
objShell.Run strShellCommand, 0, True
'_________________________________
'Return when log is complete
Dim intFileNumber As Variant
Do While Dir(strLogFile, vbNormal) = ""
DoEvents
Loop
Debug.Print strLogFile
End Function
log file generated by that command. The problem is that
my program continues after I've shell to ftp, and does not
wait until ftp is finished; my log file is incomplete.
I tried a loop (shown below) to wait until the log file is
present, but the file is apparently cataloged before it is
complete.
Any help you can offer is greatly appreciated.
Thanks
George
PS: I am open to any solution. (I'm not tied to this
direction).
Function ftp_Shell()
strKeyFile = "C:\MyKeys.txt"
strLogFile = "C:\MyLog.prn"
strShellCommand = Replace("%comspec% /c ftp.exe -s:|" &
strKeyFile & "| >|" & strLogFile & "|", "|", Chr(34))
objShell.Run strShellCommand, 0, True
'_________________________________
'Return when log is complete
Dim intFileNumber As Variant
Do While Dir(strLogFile, vbNormal) = ""
DoEvents
Loop
Debug.Print strLogFile
End Function