Skip to content

Processes running on remote computer

Prashant Gadhave

Asked Oct 16, 2005, 7:25 PM EDT2 answers
Share
LinkedInX
I want to get all the processes running on remote computer connected to that of mine through LAN .Any ideas please.

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    Check out this sample code


    using System;
    using System.Diagnostics;
    using System.ComponentModel;

    namespace MyProcessSample
    {
        /// <summary>
        /// Shell for the sample.
        /// </summary>
        public class MyProcess
        {
            public void BindToRunningProcesses()
            {
                // Get the current process.
                Process currentProcess = Process.GetCurrentProcess();
                // Get all instances of Notepad running on the local
                // computer.
                Process [] localByName = Process.GetProcessesByName("notepad");
                // Get all instances of Notepad running on the specifiec
                // computer.
                // 1. Using the computer alias (do not precede with "\\").
                Process [] remoteByName = Process.GetProcessesByName("notepad", "myComputer");
               
                // 2. Using an IP address to specify the machineName parameter.
                Process [] ipByName = Process.GetProcessesByName("notepad", "169.0.0.0");
                
                // Get all processes running on the local computer.
                Process [] localAll = Process.GetProcesses();

                // Get all processes running on the remote computer.
                Process [] remoteAll = Process.GetProcesses("myComputer");
                // Get a process on the local computer, using the process id.
                Process localById = Process.GetProcessById(1234);
                // Get a process on a remote computer, using the process id.
                Process remoteById = Process.GetProcessById(2345, "myComputer");
               
            }
            public static void Main()
            {
                    
                 MyProcess myProcess = new MyProcess();
                myProcess.BindToRunningProcesses();

                }   
        }
    }
    0
  • 0
    Thanks for your reply.I want to know one more thing .I have got all these processes running on remote computer connected to my pc through LAN.If I want to close one of these ,what should I do ? Help me please.
    0