Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

martin

NonaSuomy wrote:

I get the same results using vbs, what was the fix?

I haven't got an answer so far.

Can you send me an email, so I can send you back a debug version of WinSCP to track the problem? Please include link back to this topic in your email. Also note in this topic that you have sent the email. Thanks.

You will find my address (if you log in) in my forum profile.
NonaSuomy

I get the same results using vbs, what was the fix?

Any chance you can add a VBS example along side the JScript one
martin

Re: Can't communicate with WinSCP Shell from script

I have sent you an email.
martin

Re: Can't communicate with WinSCP Shell from script

Thanks for your post. I'll check and contact you soon.
goandersen

Can't communicate with WinSCP Shell from script

I have encountered a new problem since installing Beta version 5.0.2 and 5.0.3.
I need to use passive mode and explicit ssl with a California government agency. I was able to do that with our previous version of WinSCP using a stored session, but I don't believe it was supported in a script until 5.0.2.
Now that we have installed 5.0.2 (and subsequently, 5.0.3), I can open the Winscp window with the following code:
WshShell = CREATEOBJECT("WScript.Shell")

WshShell.CurrentDirectory = this.icTempDirectory

ON ERROR llSuccess = .F.

oExec = WshShell.EXEC('"' + this.icWinSCPPath + '" /log=putlog.xml')

When I try to send my script to Winscp, I get no response.

I use the following to send the script:
oExec.StdIn.WriteLine('option batch abort')
oExec.StdIn.WriteLine('option confirm off')
IF (.inReconnectTime > 0)
oExec.StdIn.WriteLine('option reconnecttime ' + ALLTRIM(STR(this.inReconnectTime)))
ENDIF
oExec.StdIn.WriteLine('open ftps://' + .icUsername + ':' + .icPassword + '@' + .icServer + lcPort + '-explicitssl -passive=on -timeout=600')
oExec.StdIn.WriteLine('get /users/apprisk/ak1/*.txt ' + lcTempDirectory)
oExec.StdIn.WriteLine('close ')
oExec.StdIn.WriteLine('exit ')


The WinSCP window doesn't close, and the application stops.
When I manually close the window and execute the following:

lcOutput = oExec.StdOut.ReadAll()

All that is returned is the "winscp>" prompt.

What has changed that is causing my problem? I have tried to use the stored sessions that were working previously, but they no longer work either.