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

John Garland

It's OK I've changed tack. I'm using DOS batch, that seems to work.
John Garland

WinSCP/VBScript Issue

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.