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

martin

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.
Jonny

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?