Link to home
Start Free TrialLog in
Avatar of H-SC
H-SCFlag for United States of America

asked on

Get Status Of Remote Machine Process

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.
ASKER CERTIFIED SOLUTION
Avatar of graye
graye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of H-SC

ASKER

graye,
This is perfect!!  Many thanks
Avatar of H-SC

ASKER

graye,

Hi,
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..?

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.
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx