Link to home
Start Free TrialLog in
Avatar of KBanner
KBanner

asked on

Process Detected on Two different Desktop Sessions

Hi,
Application is running on another remote desktop session on the same PC (using remote desktop connection) and the following code is detecting both instances on the two different desktops.
What is the easiest way to  return only the number of processes  on this one remote desktop ?
Avatar of sarabande
sarabande
Flag of Luxembourg image

you should add the code.

Sara
Avatar of KBanner
KBanner

ASKER

Public Shared Function bCheck4Running(ByVal sApp As String) As Boolean

        Dim ps() As Process
        ps = System.Diagnostics.Process.GetProcessesByName(sApp) 
        'if more than one Tracker Pro open
        If ps.Length > 1 Then

            Call KillProcess("TrackerProSplashScreen") 
            MsgBox(sApp & " is already running!", MsgBoxStyle.Critical, sApp & " Failure") 

            Return True
        End If

        Return False
    End Function

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KBanner

ASKER

Sara, Thanks so much. Let us give it a try, and get back to you.
Avatar of KBanner

ASKER

Thks Sara, forgot to give you the points! My apologies
Avatar of KBanner

ASKER

Top notch answer