Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

drhirn

VBScript - Wait until Download finished

Hi!

I'm using WinSCP in a VBScript and it's doing, what I want it to do.
The only problem i have is, that the Script is starting the next step, before the download is finished. As I don't know, how long the download will last, I don't want to use WScript.Sleep. Is there another chance to pause the script until WinSCP has finished?

Actual VBS code:

cmdFTP = "winscp.com /script=ftp_vwgh.txt /log=" & strFTPLog

set objShell = wscript.createObject("wscript.shell")
Set objWshScriptExec = objShell.Exec(cmdFTP)
Set objWshScriptExec = nothing


The WinSCP-Skript:

option batch on

option confirm off
open ftp://server:21
lcd C:\Temp\risup\VWGH_Down
get *
rm *
close
exit


I tried using
Set objWshScriptOutput = objWshScriptExec.StdOut.ReadAll()
but then I get an error:

Microsoft VBScript runtime error: Object required: '[string: "batch          on  "]'


Any help appreciated!

Thank you very much

Stefan