B
Bill Nguyen
I ran into this problem in a Terminal Server environment
When trying to kill all processes having the same name (to avoid hanging
instances of this process), my users ran into permission problem (access
denied) because the routine tried to kill other users' process as well.
Is there away to idenfity process owner in a Terminal server environment so
that only user's own processes to be eliminated?
Thanks
Bill
Dim myProcessName As String = "ProcessName"
Dim myProcesses() As Process
Dim myProcess As Process
myProcesses = Process.GetProcessesByName(myProcessName)
For Each myProcess In myProcesses
Try
myProcess.Kill()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
When trying to kill all processes having the same name (to avoid hanging
instances of this process), my users ran into permission problem (access
denied) because the routine tried to kill other users' process as well.
Is there away to idenfity process owner in a Terminal server environment so
that only user's own processes to be eliminated?
Thanks
Bill
Dim myProcessName As String = "ProcessName"
Dim myProcesses() As Process
Dim myProcess As Process
myProcesses = Process.GetProcessesByName(myProcessName)
For Each myProcess In myProcesses
Try
myProcess.Kill()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next