Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FTP & Application.Wait 1

Status
Not open for further replies.

bmoremu

Programmer
Dec 22, 2003
38
US
I have the following line to run an FTP script which transfers a file to a remote server and records the log in 'FTPoutput':

Shell "cmd /c ftp -s:" & FTPscript & " > " & FTPoutput

I want a msgbox to pop up after the transfer completes indicating that it was successful. Right now I have:

Application.Wait Now + TimeValue("00:00:25")

Then I search for the line in the log that starts with "250" indicating a successful transfer. However, the file transfer varies from 10 - 35 seconds, so is there a way I can wait for the command shell to close before searching the log??
 
If you have WSH installed, you can try this:
Code:
Set Sh = CreateObject("WScript.Shell")
cmd = "cmd /c ftp -s:" & FTPscript & " > " & FTPoutput
ReturnCode = Sh.Run(cmd, 1, True)


Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top