VBScript include winscpnet.dll error

Advertisement

Jonny
Guest

VBScript include winscpnet.dll error

The following page:
<%@Language=VBScript%>
<%Response.Buffer = True%>
<!--#include file="winscpnet.dll"-->
<%
 
 object="WinSCP.Session"
' Setup session options
Dim sessionOptions
Set sessionOptions = WScript.CreateObject("WinSCP.SessionOptions")
With sessionOptions
    .Protocol = Protocol_Sftp
    .HostName = ""
    .UserName = ""
    .Password = ""
 
End With
 
Dim session 
Set session = WScript.CreateObject("WinSCP.Session")
 
' Connect
session.Open sessionOptions
 
' Download files
Dim transferOptions
Set transferOptions = WScript.CreateObject("WinSCP.TransferOptions")
transferOptions.TransferMode = TransferMode_Binary
 
Dim transferResult
Set transferResult = session.GetFiles("", "", false, transferOptions)
 
' Throw on any error
transferResult.Check
 
' Print results
Dim transfer
For Each transfer In transferResult.Transfers
    WScript.Echo "Download of " & transfer.FileName & " succeeded"
Next
 
' Disconnect, clean up
session.Dispose
%>
returns the following error after including the file.
Active Server Pages error 'ASP 0116'

Missing close of script delimiter

..../winscpnet.dll, line 462

The Script block lacks the close of script tag (%>).
Can you help me?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,567
Location:
Prague, Czechia

Re: VBScript include winscpnet.dll error

I do not know anything about VBScript ASP pages.
But I'm quite sure that the #include is intended for including code files, not for including binary libraries.

To use the WinSCP .NET library from VBScript, you need to register it for COM:
https://winscp.net/eng/docs/library_install#registering
Then you should be able to use it without any additional code.

Reply with quote

Advertisement

You can post new topics in this forum