Get Status Of Remote Machine Process

Posted on 2010-01-11
Medium Priority
Last Modified: 2012-05-08
I would like to be able to get the status of a certain process.exe that should be running on a networked machine.  How can this be done?  The solution can involve the reporting back via a textbox on my form or a messagebox, does not matter.
Question by:H-SC
  • 2
  • 2
LVL 41

Accepted Solution

graye earned 2000 total points
ID: 26288909
This can be done via the Process class
It would look something like this:

Dim myProcesses As Process() = Process.GetProcessesByName("notepad", remoteMachineName)
If myProcesses.Length = 0 Then
     Console.WriteLine("Could not find notepad processes on remote computer.")
End If

For Each myProcess as Process In myProcesses
    Console.WriteLine("Process Name : " & myProcess.ProcessName & "  Process ID : " & myProcess.Id & "  StartTime: " & myProcess.StartTime.ToString)

Open in new window


Author Comment

ID: 26293160
This is perfect!!  Many thanks

Author Comment

ID: 26303458

quick follow-up to this one..... I am getting an error of "could not connect to remote computer",  which is ok, because in some cases the machine will not be turned on/offline.  Can I incorporate some kind of catch for that, In other words look for the machine to be out there first then look for the proc..?

LVL 41

Expert Comment

ID: 26303724
This error is a very low-level thing...  it's really a Remote Procedure Call (RPC) error.  It takes about 30 seconds for the RPC to time out (and then generate thay error).  So, to speed things up, I typically try to ping the remote PC first.   A ping typically takes about 1 second to determine if the remote PC is alive and well.   If the ping suceeds, then I go the next step of actually doing any remote activities.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Suggested Courses

599 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