Topic "WinSCP/VBScript Issue"

Author Message
John Garland
[View user's profile]

Joined: 2013-01-29
Posts: 3
Location: North East England
sing the code in the "Windows script host (JScript or VB script)" section of your "Advanced FTP/SFTP scripting" document, I created the following:



Option Explicit

Dim ObjShell, Exec, Output, ObjMessage

Set ObjShell = CreateObject("WScript.Shell")
Set Exec = ObjShell.Exec("c:\program files\winscp\winscp.com")

Exec.StdIn.Write( _
"option batch abort\n" +_
"option confirm off\n" +_
"open myuser:mypassword@downloads.company.com\n" +_
"get /remotepathname/remotefilename.zip c:\localpathname\localfilename.zip\n" +_
"exit\n")

Output = Exec.StdOut.ReadAll()

WScript.Echo(Output)



When I run it a blank console screen appears and the script seems to hang. On closing the screen Output is displayed and contains the WinSCP command prompt. I've tried several solutions from your help pages and Google (to do with ReadAll and StdOut/StdErr issues of which I know little)and have drawn a blank. Any pointers/suggestions/clues appreciated.
John Garland
[View user's profile]

Joined: 2013-01-29
Posts: 3
Location: North East England
It's OK I've changed tack. I'm using DOS batch, that seems to work.
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