GetProcesses unfortunately doesn't return that piece of information. Here's
a link to another post that shows how:
http://groups.google.com/group/micro...6272a9b7ecd77b
Here's the code translated to VB.NET
Imports System.Management
Module Module1
Class Sample_SelectQuery
Public Shared Sub Main()
Dim selectQuery As SelectQuery = New SelectQuery("Win32_Process")
Dim searcher As ManagementObjectSearcher = New
ManagementObjectSearcher(selectQuery)
For Each proc As ManagementObject In searcher.Get
Console.WriteLine(proc("Name").ToString)
Dim s(1) As String
proc.InvokeMethod("GetOwner", CType(s, Object()))
Console.WriteLine(("User: " & (s(1) + ("\\" + s(0)))))
Next
Console.ReadLine()
End Sub
End Class
End Module
HTH
"Ken Soenen" wrote:
I can get all the processes on the local machine using "GetProcesses". Now I
need to know the owner of each of these processes. If the Windows Task
Manager could talk, I would ask it.!!
Any help would be appreciated. I still haven't mastered the finer points(if
there are any) of finding something in VB.NET help. Sometimes it takes me
days to find even something simple.
thanks,
ken