' This will throw an exception if there is no such process.ĭim localById As Process = Process.GetProcessById(1234) ' Get a process on the local computer, using the process id. ' This will return an empty array if notepad isn't running.ĭim localByName As Process() = Process.GetProcessesByName("notepad") ' Get all instances of Notepad running on the local computer. ' Get all processes running on the local computer.ĭim localAll As Process() = Process.GetProcesses() ' to access various properties and call methods to control the process.ĭim currentProcess As Process = Process.GetCurrentProcess() You can use currentProcess from this point Process remoteById = Process.GetProcessById(2345, "m圜omputer") Process ipByName = Process.GetProcessesByName("notepad", "169.0.0.0") Process remoteByName = Process.GetProcessesByName("notepad", "m圜omputer") Process remoteAll = Process.GetProcesses("m圜omputer") Process localById = Process.GetProcessById(1234) Process localByName = Process.GetProcessesByName("notepad") Process localAll = Process.GetProcesses() Process currentProcess = Process.GetCurrentProcess() Process^ remoteById = Process::GetProcessById( 2345, "m圜omputer" ) Get a process on a remote computer, using the process id and machine name. Get all instances of Notepad running on the specific computer, using IP address.Īrray^ipByName = Process::GetProcessesByName( "notepad", "169.0.0.0" ) Get all instances of Notepad running on the specific computer, using machine name.Īrray^remoteByName = Process::GetProcessesByName( "notepad", "m圜omputer" ) Get all processes on a remote computer.Īrray^remoteAll = Process::GetProcesses("m圜omputer") if "m圜omputer" and 169.0.0.0 do not exist on your local network. and all the following calls will timeout and throw an exception Get processes running on a remote computer. Process^ localById = Process::GetProcessById(1234) This will throw an exception if there is no such process. Get a process on the local computer, using the process id. This will return an empty array if notepad isn't running.Īrray^localByName = Process::GetProcessesByName("notepad") Get all instances of Notepad running on the local computer. Get all processes running on the local computer.Īrray^localAll = Process::GetProcesses() Process^ currentProcess = Process::GetCurrentProcess() It then retrieves information for the same processes on a remote computer. The following example retrieves information of the current process, processes running on the local computer, all instances of Notepad running on the local computer, and a specific process on the local computer. A problem occurred accessing an underlying system API.