0

i am trying to list running processes using VS2015 Community but it gives win32 exception any clue what is wrong here ? my objective is to detect and report the idle threads launched by 3rdparty application names of the sub-processes are different !

     imports System
     imports system.diagnostics
     imports system.componentmodel

     Try

            Dim ps() As Process
            ps = System.Diagnostics.Process.GetProcesses()
            For Each mp As Process In ps
                Debug.WriteLine(mp.MainModule.ToString)
                Dim li As New ListViewItem
                li = Me.ListView1.Items.Add("TEST")
                li.EnsureVisible()
            Next
        Catch ex As Exception
            Debug.Print(ex.Message.ToString)
        End Try

error

System.Diagnostics.ProcessModule (iusb3mon.exe)
System.Diagnostics.ProcessModule (NOTEPAD.EXE)
Exception thrown: 'System.ComponentModel.Win32Exception' in System.dll
Access is denied
shinobi92
  • 127
  • 2
  • 16
  • Possible duplicate of [Access denied while getting process path](http://stackoverflow.com/questions/3399819/access-denied-while-getting-process-path) – Visual Vincent Oct 18 '16 at 21:01
  • Try the link http://www.aboutmycode.com/net-framework/how-to-get-elevated-process-path-in-net/ it may help you – Mukul Varshney Oct 20 '16 at 04:14

0 Answers0