Hello,
I'm using the below code to display a list of processes running on a remote
machine. The code successfully grabs five or six of the processes before
getting an error that says "feature is not supported for remote machines". If
the feature isn't supported for remote machines then why is able to grab some
of the processes before getting the error? Also, I've use the
process.getprocessname successfully on remote machines to search for
instances of a particular process and had no problems. Any ideas?
Dim P As Process
Dim strProcessName As String
Dim shtNameLength As Short
Dim strServer As String
Dim strProcessList As String
Try
For Each P In Process.GetProcesses(strServer)
strProcessName = P.ToString
strProcessName = strProcessName.Remove(0, 28)
shtNameLength = strProcessName.Length
shtNameLength = shtNameLength - 1
strProcessName = strProcessName.Remove(shtNameLength, 1)
strProcessList &= strProcessName & Environment.NewLine
Next
Catch
MessageBox.Show(Err.Description, "Error Gathering Processes",
MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
txt1.Text = strProcessList