Questions tagged [winscp-net]

The WinSCP .NET assembly (winscpnet.dll) is a .NET wrapper around WinSCP's scripting interface that allows your code to connect to a remote machine and manipulate remote files over SFTP, FTP, WebDAV and SCP sessions from .NET languages, such as C#, VB.NET, and others, or from environments supporting .NET, such as PowerShell and SQL Server Integration Services (SSIS).

The WinSCP .NET assembly winscpnet.dll is a .NET wrapper around WinSCP's scripting interface that allows your code to connect to a remote machine and manipulate remote files over SFTP, FTP, WebDAV and SCP sessions from .NET languages, such as C#, VB.NET, and others, or from environments supporting .NET, such as PowerShell and SQL Server Integration Services (SSIS).

For details see:

The assembly is also exposed to COM, and as such it can be used from variety of other programming languages and development environments--e.g., WSH-hosted active scripting languages like JScript and VBScript, Visual Basic for Applications (VBA), Perl, and Python.

For details see:

The library is primarily intended for advanced automation tasks that require conditional processing, loops or other control structures for which the basic scripting interface is too limited. The library is not a general purpose file transfer library. It particularly lacks support for interactive processing and as such it is not well suited for use in GUI applications.

Use tag for all WinSCP related questions, along with .

271 questions
4
votes
1 answer

WinSCP .NET assembly SynchronizeDirectories: Upload of file ... was successful, but error occurred while setting the permissions and/or timestamp

I am using WinSCP .NET Assembly in PowerShell for file synchronization with a SFTP server. I am using the following code for synchronization: http://winscp.net/eng/docs/library_session_synchronizedirectories#powershell Problem is, when this script…
cloudify
  • 73
  • 1
  • 7
4
votes
3 answers

SSIS C# 2012 Script Task referring WinSCPnet.dll fails when run from SQL Server Agent with "Exception has been thrown by the target of an invocation"

I have an SSIS package (created in VS 2013) that contains a C# 2012 Script Task. The job of the script task is to download a file from an SFTP server using WinSCP .NET assembly and place it on my server (Windows Server 2012 R2 with SQL Server…
4
votes
1 answer

WinSCP .NET assembly throwing "The winscp.exe executable was not found at location of the assembly" when installed to GAC for SSIS

I have a package which downloads files from FTP using WinSCP which runs perfectly when I execute it locally. But we are facing issues when we run from the deployed version from SSIS DB Catalog. GAC registration already done for the .dll file. Below…
Prakazz
  • 321
  • 5
  • 16
3
votes
2 answers

Monitoring uploaded files on FTP server using WinSCP .NET assembly in PowerShell

I trying to write PowerShell script who can send a email when a new file his drop on a FTP (I'm not the owner of the FTP so I can't do a cron job). I got a error because I'm using the Contains method and after some research Contains doesn't work…
Ivanova
  • 55
  • 3
3
votes
0 answers

Powershell7 WinSCP New-WinSCPSession Exception

I have an existing Powershell script which works without issue in PowerShell 5.1. After installing PowerShell 7, the script no longer works and it fails when trying to establish a WinSCP session. First, session options are created via…
Mike .
  • 580
  • 1
  • 5
  • 20
3
votes
1 answer

How to download a single file using Session.GetFiles in WinSCP C#

So, basically I am trying to download only one file from the entire folder on my server. Folder "domain" contains those files right now: File1.txt File2.txt File3.txt So, as I can see in WinSCP docs if I want to download only one file I still…
Stas Mackarow
  • 145
  • 1
  • 4
  • 13
3
votes
1 answer

How do I use DTS.Events.FireInformation() in SSIS Script Task while handling WinSCPnet.dll FileTransferProgress?

I have a Script Task in an SSIS (2008) package that downloads files from a remote FTP server to a local directory. The Script Task is written in C# 2008, and uses WinSCPnet.dll. Using examples from WinSCP's documentation, I came up with the script…
digital.aaron
  • 4,975
  • 1
  • 21
  • 41
3
votes
1 answer

Perl - Win32::OLE::const error

I’m trying to use WinSCP for SFTP with a Perl script. I’m pretty much using the code off of the WinSCP site verbatim. But I’m getting the following error: Win32::OLE::CONST->Load: No or invalid type library name at test.pl line 12.…
Cory Kleiser
  • 1,831
  • 2
  • 9
  • 22
3
votes
1 answer

"Host key does not match configured key" when connecting to SFTP server with WinSCP .NET assembly

I'm having some trouble while trying to implement an SFTP connection via C#. At the moment I can connect using WinSCP with my host, port, login, password and the key file (ppk file). My implementation is just like this using WinSCP…
briba
  • 2,556
  • 1
  • 25
  • 44
3
votes
1 answer

A WinSCP script to download, rename, and move files

Disclaimer #1: I posted this question on the WinSCP's forum but haven't received any replies and this issue is time-sensitive.Disclaimer #2: I'm basing the legitimacy of this cross-post on advice found on the subject from Meta.With that…
Eliezer
  • 419
  • 1
  • 8
  • 20
3
votes
1 answer

Watch for changes in local folder and upload them to SFTP server

Linux user here trying to write a script in PowerShell to automate SFTP transfers from a Windows server to a remote server. I have everything working for the most part (though I still have some testing to do). My current issue is after the script…
pskz134
  • 31
  • 5
3
votes
1 answer

Copy files to FTP and archive with today's date

I need to create a script that does the following: Copies all files in a folder to an FTP site. If the copy was successful move the files to an archive. The archive should be a freshly created folder with today's date (so we know when they were…
SysAdminUK
  • 37
  • 6
3
votes
1 answer

Multiple file mask for WinSCP Session.EnumerateRemoteFiles

I'm rebuilding the FTP portion of a system monitor app, has to be able to download any file that is: .csv .xlsx .xls and when I try to setup that mask, its returning 0 files, but if I pick just one of them, it works perfectly. string FileMask =…
Eddie
  • 838
  • 1
  • 19
  • 42
3
votes
2 answers

Code to download file from FTP with WinSCP .NET assembly does not connect, but I can connect in WinSCP GUI

I need to download a file from FTP thru WinSCP .NET assembly. I have this code currently but the error says Authentication failed. try { SessionOptions sessionOptions = new SessionOptions { Protocol = Protocol.Ftp, HostName…
theo
  • 223
  • 3
  • 15
3
votes
2 answers

Cancel file transfers while transferring file to destination

I have used Winscp for file transferring and got details file transfer progress like below link, File transfer details binding continuously until file transfered in window using WPF and transfer code link…
Arun D
  • 279
  • 3
  • 15
1
2
3
18 19