Solved

Process Detected on Two different Desktop Sessions

Posted on 2013-10-29
6
277 Views
Last Modified: 2013-11-22
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 ?
0
Comment
Question by:KBanner
  • 4
  • 2
6 Comments
 
LVL 33

Expert Comment

by:sarabande
ID: 39610929
you should add the code.

Sara
0
 

Author Comment

by:KBanner
ID: 39611194
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

0
 
LVL 33

Accepted Solution

by:
sarabande earned 500 total points
ID: 39611225
you may check whether the "MachineName" property of the processes in the returned array would be different for the processes running at the remote desktop. if so, you could use an overload of GetProcessesByName which takes two arguments, one for the name and one for the machine.

if the machine name is not different you may check other properties for filtering. see

http://msdn.microsoft.com/en-us/library/System.Diagnostics.Process_properties(v=vs.110).aspx


Sara
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:KBanner
ID: 39611283
Sara, Thanks so much. Let us give it a try, and get back to you.
0
 

Author Comment

by:KBanner
ID: 39668853
Thks Sara, forgot to give you the points! My apologies
0
 

Author Closing Comment

by:KBanner
ID: 39668854
Top notch answer
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question