Manage Processes on Remote Machines over the Net-Remote Process Manager


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

Environment: Visual Studio .NET—C#, Windows 2000/XP

Remote process manager is an application that is useful for starting and killing processes on machines over the network (Internet). There is a Remote Process Invoker Server application, which must be run on the machine on which we want to manage the processes, and a client application that provides the UI.

This project will help readers understand the basics of .NET remoting, Win UI programming in C#, and the System.Diagnostics namespace. .NET Remoting is used in this project to bring Process objects on a remote machine to the client machine.

There are three binaries in ProcRunner.dll, which contains the object that is being remoted by the ExecServer.exe application, which is to be run on the machine in which processes are to be managed remotely. The ExecClient.exe application is run as the client program, which provides the user with a UI to start and stop processes on the remote machine. This application also lists the details of running processes on the remote machine.

The ProcRunner.dll the CprocRunner class has the functionalities of starting, stopping, and getting a list of running processes.

Here is a simple piece of code for starting a process with arguments:

public bool RunProcess(string strProgramName, string strArgs)
  Process proc = new Process();
  proc.StartInfo.FileName = strProgramName;
  if (strArgs != string.Empty)
    proc.StartInfo.Arguments = strArgs;

To get the processes' list :

Process[] process = Process.GetProcesses();

ExecServer is a Windows application that simply hosts the ProcRunner object. This object is being remoted as a singleton. A tray icon will be shown when the server is run, as shown in the following figure.

The client application simply creates an object of CProcRunner, and calls the GetProcesses(), Kill(Process), and RunProcess(ProcessName, Args) methods.

Remoting Configuration

The remoting configuration for the two exes is provided with the help of two application configuration files. No change for the server exe's config file is needed. But, before running the client, change the URL field in the app config file to point to the server machine's URL .

wellknown type="ProcRunner.CProcRunner,ProcRunner"
          url="tcp://[SERVER MACHINE NAME]:7500/ProcRunner"

How to Build and Run the Project

Unzip the code to a folder. Open the solution in the "SingleSolution" folder, and build the solution. By default, the client app config file will point to the remote object on the "localhost" machine. Now, you can run the client and server on the same machine. For managing processes on a remote machine, run the server in that machine, and run the client from your local machine AFTER editing the client config file and making it point to the url of the server. Refer to "Remoting Configuration" above.


Download demo project - 25 Kb
Download source - 62 Kb


  • killing process not working in localhost

    Posted by bikashroutray on 07/12/2007 09:44am

    I am implemented the single solution on my windows XP machine as client as well as server. 
    But when i am trying to kill the process i am getting the following error :
    An unhandled exception of type
    'System.Runtime.Serialization.SerializationException' occured in mscorlib.dll
    Additional information: Because of security restrictions, the type
    System.Runtime.Remoting.ObjRef cannot be accessed.
    Can anyone help me on this?

  • Running the ExecServer as a service

    Posted by torel on 07/14/2005 04:59pm

    What would it take to run the application as a service on the remote computer? The reason for this question is toA be able to submit jobs without the need to be logged in on the remote computer. As far as I know, only a service can be loaded prior to logging in on a computer? Any hints on how to do this? best regards Tore

  • killing process is not working]

    Posted by anilmane on 10/26/2004 09:26pm

    hello gurus I have checked at my place is working fine in network. works very fine. But when i use kill process it gives error which is not working fine Could you please guide me. Thanks Anil M.

  • Can i give IP in the server name?

    Posted by Legacy on 02/26/2004 08:00am

    Originally posted by: venkat

    In the place of server name can i type the IP address of the remote machine(not in the same domain) and still continue using like this?


    • Yes IP Address will work

      Posted by suniltg on 04/21/2004 02:44pm

      Because this is designed to run over the internet, best idea is to give IP address rather than machine name. Sunil

  • Thanks

    Posted by Legacy on 11/14/2003 08:00am

    Originally posted by: Michael Hardt

    Just wanted to add my thanks for this outstanding sample. It's been very useful for me.

  • Process.Kill() does not seem to work across remote machines

    Posted by Legacy on 04/20/2003 07:00am

    Originally posted by: Andy

    When I call Process.Kill() on the client, the server object throws a remoting exception. Any help would be useful.

  • Great Work

    Posted by Legacy on 04/04/2003 08:00am

    Originally posted by: Dipin

    Its a great work .It will very useful. I thank to Sunil for such programs.

  • Very good example

    Posted by Legacy on 03/26/2003 08:00am

    Originally posted by: akolev

    It's very good example on .Net remoting.I wish to know where there are more exapmles like this about .Net remoting ( besides www.codeguru.com and www.codeproject.com )

  • Quite useful

    Posted by Legacy on 12/05/2002 08:00am

    Originally posted by: Sameer

    This application is helping me to understand concepts of client/server. Being new to this, I am finding this quite useful. Many thanks.

  • great work.very informative !!

    Posted by Legacy on 11/28/2002 08:00am

    Originally posted by: ravindranath

  • Loading, Please Wait ...

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date