Skip to content

GetProcesses: on a remote computer #7593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion xml/System.Diagnostics/Process.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1617,6 +1617,7 @@ The following code example creates a process that prints a file. It sets the <xr

]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The host system does not support a native call to <c>EnumProcesses</c>.</exception>
<altmember cref="P:System.Diagnostics.Process.MachineName" />
<altmember cref="M:System.Diagnostics.Process.GetProcessById(System.Int32,System.String)" />
<altmember cref="M:System.Diagnostics.Process.GetProcessesByName(System.String)" />
Expand Down Expand Up @@ -1672,7 +1673,7 @@ The following code example creates a process that prints a file. It sets the <xr
<format type="text/markdown"><![CDATA[

## Remarks
Use this method to create an array of new <xref:System.Diagnostics.Process> components and associate them with all the process resources on the specified (usually remote) computer. The process resources must already exist on the local computer, because <xref:System.Diagnostics.Process.GetProcesses%2A> does not create system resources but rather associates resources with application-generated <xref:System.Diagnostics.Process> components. Because the operating system itself is running background processes, this array is never empty.
Use this method to create an array of new <xref:System.Diagnostics.Process> components and associate them with all the process resources on the specified (usually remote) computer. The process resources must already exist on that computer, because <xref:System.Diagnostics.Process.GetProcesses%2A> does not create system resources but rather associates resources with application-generated <xref:System.Diagnostics.Process> components. Because the operating system itself is running background processes, this array is never empty.

If you do not want to retrieve all the processes running on the computer, you can restrict their number by using the <xref:System.Diagnostics.Process.GetProcessById%2A> or <xref:System.Diagnostics.Process.GetProcessesByName%2A> method. <xref:System.Diagnostics.Process.GetProcessById%2A> creates a <xref:System.Diagnostics.Process> component that is associated with the process identified on the system by the process identifier that you pass to the method. <xref:System.Diagnostics.Process.GetProcessesByName%2A> creates an array of <xref:System.Diagnostics.Process> components whose associated process resources share the executable file you pass to the method.

Expand Down