Solved

Check if a process exists on server

Posted on 2006-11-03
3
159 Views
Last Modified: 2009-07-29
How can I check if a process such as cmd.exe exists on \\server. Thanks.
0
Comment
Question by:sandya_116
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
iHadi earned 500 total points
Comment Utility
Hi Sandya_116

Copy the following function to your project and use it like this: FindProcess("Server", "cmd")

    Private Function FindProcess(ByVal MachineName As String, ByVal ProcessName As String)
        Dim PList() As System.Diagnostics.Process
        Dim Res As Boolean = False

        PList = System.Diagnostics.Process.GetProcesses(MachineName)

        For i As Integer = 0 To PList.Length - 1
            If PList(i).ProcessName = ProcessName Then
                Res = True
                Exit For
            End If
        Next

        If Res = True Then
            MessageBox.Show("Process: """ & ProcessName & """ found on machine: " & MachineName)
        Else
            MessageBox.Show("Process: """ & ProcessName & """ not found on machine: " & MachineName)
        End If
        Return Res
    End Function
0
 
LVL 13

Expert Comment

by:iHadi
Comment Utility
0
 

Author Comment

by:sandya_116
Comment Utility
Thanks iHadi. That worked.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now