Post a reply

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)


Topic review


Thanks for sharing your solution (while I'm not really sure it was 32-bit vs. 64-bit issue, as you should be able to have both).

I had registered both 32 and 64-bit DLL.
As described here ( the last registered DLL will be used (in my case that was the 64-bit).
But my scripting language (oRexx) was 32-bit hence the error that the OLE object did not load.

My solution:
- unregister all (winscp /comregistration, and follow instructions)
- register only the 32-bit

Now my code runs with no errors.

If I make that the first statement after the
session = .OLEobject~New("WinSCP.Session")

then I get that same error.
Had tried that before.
Thanks anyway for the replies.

You can try to set Session.DebugLogPath, to see what's happening "inside".
Though I rather expect that it's a problem outside of the assembly, you won't be able to set the property anyway. But it's worth trying.

Thanks for looking at this.
Did I say that these ooRexx/WinSCP scripts run fine on WIN7?
Just not on WIN10.
I have posted this problem also in the ooRexx community but apparently not many WinSCP users there.

Is there really no option for WinSCP to show what is happening 'inside'? Any debugging info would help me.

Thanks, Andre

Re: .NET and ooRexx - OK in WIN7 but error in WIN10

Sorry, I do not know how to help you. I have no experience with ooRexx. As COM registration seems to be OK (as VBScript works), this seems to be something about ooRexx, with which I cannot offer any help.

Re: .NET and ooRexx - OK in WIN7 but error in WIN10

I added LogPath statements a follows:

session = .OLEobject~New("WinSCP.Session")
session~SessionLogPath = "session.txt"
session~DebugLogPath = "debug.txt"

Same error, but now at the statement:
session~SessionLogPath = "session.txt"

Re: .NET and ooRexx - OK in WIN7 but error in WIN10

Do you get any log file, if you enable logging using Session.SessionLogPath or Session.DebugLogPath?

.NET and ooRexx - OK in WIN7 but error in WIN10

I use the .NET assembly. My scripting language is Open Object Rexx.
These lines of (ooRexx) code have been working fine on Windows 7 for months.
If all goes well it prints the name of the SFTP server home directory.
/** REXX **/

protocol_sftp   = 0
server     = 'sftp.******.**'
port       = 22
userid     = '*******'
passwd     = '*******'
hostkey    = 'ssh-ed25519 256 ***********************************************'
Say 'Logging on to server.....'
sessionoptions = .OLEobject~New("WinSCP.SessionOptions")
SessionOptions~sshhostkeyfingerprint = hostkey
SessionOptions~hostname   = server
SessionOptions~username   = userid
SessionOptions~password   = passwd
SessionOptions~portnumber = port
SessionOptions~Protocol   = protocol_sftp
session = .OLEobject~New("WinSCP.Session")
Say session~Homepath

But on WIN10 these lines fail on the session~Open statement.
       *-* Compiled method "UNKNOWN" with scope "OLEObject".

    23 *-* session~Open(sessionoptions)
Error 92 running z:\winscp-test\test.rex line 23:  OLE error.
Error 92.901:  An unknown OLE error occurred (HRESULT=80070057).

Looking up 80070057 I find:
E_INVALIDARG One or more arguments are not valid

When I rewrite this script for VbScript (not included here) I have no error on WIN10, so I am assuming the DLL is installed fine.
Can anybody advise me how to debug this?
Thanks, Andre