Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Check if a process exists on server

Posted on 2006-11-03
3
162 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

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 …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

839 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