Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Check if a process exists on server

Posted on 2006-11-03
3
Medium Priority
?
165 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
[X]
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
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
iHadi earned 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 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