Topic "Multiple WinSCP.exe processes"

Author Message
Rob5624
[View user's profile]

Joined: 2015-09-30
Posts: 5
I created some FTP routine as part of a Visual Basic application that calls WinSCP three times during runtime.
Every time a call to WinSCP is initiated via the WinSCPnet.dll a new "WinSPC.exe" process pops up connected to my application (i.e. as child processes).
I would have expected that a single process would pop up, or at least that every call would re-use the existing process.
What makes things worse is that at the moment my application stops the "WinSCP.exe" processes keeps on running...

Looking for a way to prevent this from happening, I don't like the idea of multiple ghost processes in memory...

Thanks in advance!
Advertisements
Rob5624
[View user's profile]

Joined: 2015-09-30
Posts: 5
Added the close method to the tool, now only one ghost "WinSCP.exe" remains in memory... still not the solution I look for.
Dispose method results in the same as the close method... every time my application closes a single "WinSCP.exe" process remains in memory, so after ten runs the process is there 10 times...
Rob5624
[View user's profile]

Joined: 2015-09-30
Posts: 5
Finally added the following VB code to find and kill WinSCP.exe processes started by my application:

Imports System.Management

Dim myId = Process.GetCurrentProcess.Id
Dim selectQuery As SelectQuery = New SelectQuery("Win32_Process", "Name = 'WinSCP.exe'")
Dim searcher As New ManagementObjectSearcher(selectQuery)
For Each proc As ManagementObject In searcher.Get
If (proc("ParentProcessId") = myId) And (proc("name") = "WinSCP.exe") Then Process.GetProcessById(proc("ProcessId")).Kill()
Next

Not the most efficient, but it works.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Are you using the latest version of WinSCP .NET assembly?
Guest




Yes, I downloaded it earlier this week.
Rob5624
[View user's profile]

Joined: 2015-09-30
Posts: 5
I used the downloaded version 5.7.5 dll and exe
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
Please attach a full session debug log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.DebugLogPath. Submit the log with your post as an attachment. If you do not want to post the log publicly, you can mark the attachment as private.
Rob5624
[View user's profile]

Joined: 2015-09-30
Posts: 5
Hi Prykril,

Thanks for the suggestion... helped me to find the cause for the "ghost"...
I added the "dispose" to the session I used to update data... however I forgot to add it to a second session which I used to check the initial state of a remote folder... Sad
So I added the dispose there as well and now the ghost process also disappears!

(I was able to get 2 log files where I expected to get 3 by adding the microseconds to the logfile)

So issue solved:-)
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License