Solved

Check if a process exists on server

Posted on 2006-11-03
3
161 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
ID: 17870909
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
ID: 17870957
0
 

Author Comment

by:sandya_116
ID: 17874007
Thanks iHadi. That worked.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

778 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