Post a reply

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)


Topic review


Sorry, I have no idea why the server keeps disconnecting you. It looks like a server-side bug.


i am trying to copy files over the network through winscp. I am using the assembly as per your advice. there are 100 folders on my root directory and each folder contains 100-150 files. i have attached the session log, I am getting connection time outs for all my session. Could you please help me with this?

Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

i tried using the assembly too but the issue remains same if there are 75 files in my folder and i post them one by one only 10-15 files gets posted.

Re: Help required with logging and files not being posted.\

To enable logging, use /log=c:\path\winscp.log command-line parameter.

Though I highly recommend you to use WinSCP .NET assembly, instead of trying to run winscp.exe yourself.

Help required with logging and files not being posted.\


i am using below code for transferring files to WinSCP. "SourcePath" are the directories,"SourcePathRecordings" are the files contained in those directories and there are almost 100 files in each directory. The issue i have been encountering is

1. sometimes the files doesn't get posted, if there are 100 files in the directory only 40-50 get posted although i have the loop on each file.
2. I want to enable WINSCP logging, and i want the log file to save on the local system. how would i do that?

Urgent help will be highly appreciated! :roll:

for (int a = 0; a < SourcePath.Length; a++)
string[] SourcePathRecordings = Directory.GetFiles(SourcePath[a]);
for (int i = 0; i < SourcePathRecordings.Length; i++)
string CommandText = "";
CommandText += @"/command ""option batch abort"" ""option confirm off"" ""Open """"" + SFTPAddress;
CommandText += @""""" -passive=on"" ""Put """"" + SourcePathRecordings[i];
CommandText += @""""" """"" + TargetPath + @"""""";
CommandText += @""" ""close"" ""exit"" ";
Process winscp = new Process();
winscp.StartInfo.FileName = @"C:\WinSCP3\WinSCP.exe"
winscp.StartInfo.Arguments = CommandText;
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.ErrorDialog = true;