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
1
vote
1 answer

Run command sudo bash with WinSCP .NET assembly

I am trying to run command sudo bash using VB.NET and WinSCP. I am using this code: Try Dim mySessionOptions As New SessionOptions With mySessionOptions .Protocol = Protocol.Sftp .HostName = "10.5...." .UserName =…
babboon
  • 683
  • 3
  • 20
  • 45
1
vote
1 answer

How to run a shell script [.sh] from WinSCP process in C# .NET

I have done the following steps successfully: I have created an WinSCP [Process] in C# .NET Created a Session of a user on LINUX-server [Using SFTP Protocol] Downloaded the files using GetFiles(........); The thing I want to add to my App is…
Asif Mehmood
  • 964
  • 2
  • 14
  • 35
1
vote
1 answer

Increment filename-number by the amount of files in directory .Net

My program finds and lists all files located on a remote folder. The same program is able to save new files created into the same folder. I can decide the filename, but I need the program to give some sort of "ID" to each of them. I would like the…
PiperMp3
  • 53
  • 9
1
vote
1 answer

Getting SSH host key from WinSCP .NET assembly connection

I am building a SFTP based application using WinSCP .NET assembly. One 'key' thing that I seem to be missing is that there doesn't appear to be a way for the application to validate the host it's connected to using the SSH-Key unless the user is…
TheOddPerson
  • 149
  • 1
  • 7
1
vote
2 answers

Converting WinSCP script to C# code using WinSCP .NET assembly

I've been downloading files from an external server using WinSCP for over a year by firing out external scripts from my C# code on a daily task run automatically. I recently upgraded to version 5.5.6 (from V4.3.5.1463) so that I could make use of…
MisterT
  • 31
  • 1
  • 5
1
vote
2 answers

WinSCP C# first use

I installed WinSCP on my PC and want to get a connection to another server through a C# Console Application. using WinSCP; namespace WINSCP_SFTP { class Program { static void Main(string[] args) { try …
ZerOne
  • 1,296
  • 6
  • 20
  • 40
1
vote
1 answer

Remove or move only selected files with SFTP protocol using WinSCP .NET assembly

I'm trying to develop a simple SFTP file transferring project with following operations Upload Download Move files within the remote server Remove files While uploading in session.PutFiles() we have a property called transferOptions.FileMask to…
user2435880
  • 71
  • 2
  • 8
1
vote
1 answer

How to use .crt file for SSH public key authentication

I am developing SFTP WinSCP client using C# (.NET Assembly). In my testing environment I did it by password authentication. Here are my session options: // Setup session options SessionOptions sessionOptions = new SessionOptions { Protocol =…
Suravi
  • 301
  • 1
  • 7
  • 21
1
vote
1 answer

"Host key wasn't verified!" when connecting using WinSCP .NET assembly

I'm trying to establish a connection to SFTP server with following code, I'll receive this error message "Host key wasn't verified!". SessionOptions so = new SessionOptions { Protocol = Protocol.Sftp, HostName = "xx.xx.xx.xx", …
huahsin68
  • 6,819
  • 20
  • 79
  • 113
1
vote
1 answer

WinSCP .NET assembly doesn't work on Azure

I have problem with WinSCP .NET assembly (NuGet plugin) executing on Azure. All is working on localhost, but when I deploy my Web App on Azure I get following error: WinSCP process terminated with exit code -1073741819 and output "", without…
Niezborala
  • 1,857
  • 1
  • 18
  • 27
1
vote
1 answer

WinSCP: Using GetFiles() encounter Junction Directory

[Question] Can WinSCP handle Junction directory? I am using C++/CLI to program a SFTP program using WinSCP .NET assembly (version 5.5.3). My program reads in a schedule file. Originally the source path for get file has to be absolute path. Now that…
1
vote
1 answer

Any memory leak by delete and create same object several times

It may be just a memory leak question. For those not familiar with WinSCP, skip ahead to question. I am using .net assembly of WinSCP in a C++/CLI program. My program will read in a schedule file. The file instructs the program to transfer files…
1
vote
2 answers

WinSCP .NET assembly: Set a custom event handler to Session.FileTransferred in C++/CLI

Sorry I have a bit specified question. Yes this is related to setting a custom Event Handler to an event. Yes, this type of questions may have already been asked many times, but here I have to restrict to WinSCP situation. Refer to example in…
1
vote
1 answer

WinSCP .NET assembly: FileMask in Directory Synchronization not working

Here is what I want to do in laymen terms first: I want to get files (and maybe some files only). If there are sub-directories, I want to get files in those sub-directories as well. I am using Visual C++/CLI to program, so I am using .net…
1
vote
1 answer

Can I suppress the MLSD with WinSCP .NET assembly?

I'm using WinSCP .NET assembly. When I call the Session.PutFiles method, it sends the following series of commands: TYPE A PASV MLSD TYPE A PASV STOR myfile Is there a way to tell it NOT to send the MLSD? (MLSD requests the contents of the remote…
Jay
  • 26,876
  • 10
  • 61
  • 112