List Current Processes

By KuTsuM on Sep 26, 2007

This snippet will list all of your system's current processes that are running into a console window using VB.NET. To load the snippet, go to File>New Project>Console Application and copy paste the module.

Module Processes
    Dim x As Integer = 0
    Sub Main()
        Dim pList() As System.Diagnostics.Process = _
        For Each proc As System.Diagnostics.Process In pList
            System.Console.WriteLine(proc.ProcessName & " " & proc.Id)
            x += 1
        System.Console.WriteLine(vbCrLf + "*** Number of processes: " & x)
    End Sub
End Module


Sign in to comment.
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.