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 .

339 questions
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
  • 4
3
votes
1 answer

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
  • 1,010
  • 1
  • 14
  • 33
3
votes
1 answer

WinSCP upload file to remote SFTP error: "Cannot create remote file – Permission denied"

We were doing some manual process to download from and upload to a remote SFTP server with FileZilla. With the client software we didn't have any permission issues. Recently we decided to move it to a scheduled function using VB.NET. The downloading…
Cal
  • 747
  • 1
  • 13
  • 30
3
votes
1 answer

What exception types can be thrown in processing by WinSCP .NET assembly

I found WinSCP as a great solution for integrating SFTP download with an existing process. However, I have not been able to locate the types of errors that can be thrown by the .NET wrapper. I like to have granular error processing where I can but…
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,969
  • 2
  • 13
  • 26
3
votes
2 answers

How to delete files older than x days from SFTP server in PowerShell

The below PowerShell script connects to my SFTP sever and deletes all my files under the path /test/my_file/. Is there a way where I can say only delete files that is five days old under the path /test/my_file/. Add-Type -Path "…
rich dave
  • 57
  • 1
  • 7
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,857
  • 2
  • 31
  • 59
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
  • 429
  • 1
  • 9
  • 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
  • 1
  • 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
  • 1
  • 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 =…
Eman
  • 1,093
  • 2
  • 26
  • 49
3
votes
1 answer

Prevent incomplete file transfer over FTP using WinSCP .NET Assembly

I am simply trying to transfer text files from one FTP server to another using a windows service. I download the required files from source FTP server and save it locally on my system and then upload the saved file to the destination server. For…
Jordan
  • 713
  • 15
  • 30
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
  • 18
3
votes
2 answers

Download file chunks with offset from SFTP server using WinSCP .NET assembly

We currently are using WinSCP .NET assembly to interact with SFTP servers. Our use case involves fetching parts of a file in chunks. I see that TransferResumeSupportState transfer option can be used to resume the file download but does not give…
Varun Gore
  • 31
  • 4
3
votes
2 answers

WinSCP error "No such file" when uploading files to server

Currently I'm programmatically trying to upload files to a server using the WinSCP API. However looking at the log files every time I attempt to do this I get an error stating that the remote file or it's directory doesn't exist. Code: Dim objftp As…
Andrew Ferguson
  • 179
  • 1
  • 3
  • 15
1 2
3
22 23