Topic "VBScript - Wait until Download finished"

Author Message
drhirn
[View user's profile]

Joined: 2010-11-09
Posts: 1
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:

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:

Code:

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


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

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


Any help appreciated!

Thank you very much

Stefan
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License