As in the title, in my program, i use that code for getting the file path of a process, once it gets the path, it is put into a list view which has details like the task manager. the code works fine the first time, but with a little bug that is, when it reaches the vhost of my program. For some reason, it just copies the file path of my program even though the process has changed. After the code has gone through, i want it to refresh the list so as doing the same as when loaded...so I let it refresh and once again it copies the path of the vhost, but this time it has basically taken over every process' location. So in turn, I only get returned my programs location, for something like the task managers location, where it would be like "C:\Windows\system32\tskmgr.exe"

Here's the code:

VB Code:
  1. Private Sub frmmain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.         Dim Process As New Process()
  3.         Dim Count As Integer = 0
  4.         lstvproc.Items.Clear()
  5.  
  6.         For Each Process In Process.GetProcesses(My.Computer.Name)
  7.             On Error Resume Next
  8.             lstvproc.Items.Add(Process.ProcessName() + ".exe")
  9.             lstvproc.Items(Count).SubItems.Add(FormatNumber(Process.WorkingSet64 / 1024, NumDigitsAfterDecimal:=0) & " K")
  10.             If Process.MainModule.FileName = "" Then    <<< starts here.
  11.                 lstvproc.Items(Count).SubItems.Add("")
  12.             Else
  13.                 lstvproc.Items(Count).SubItems.Add(Process.MainModule.FileName)
  14.             End If
  15.             lstvproc.Items(Count).SubItems.Add(Process.Id)
  16.             Count += 1
  17.  
  18.         Next
  19.         tmrcpu.Start()
  20.         tlblproc.Text = "Processes: " & lstvproc.Items.Count
  21.     End Sub

The refresh code is frmmain_Load(Nothing, Nothing) just to make things easy for me right now, while i get that part of the program going.

To me it seems to be working fine, but why it does that what it does, im not sure. as you can see, the process changes. and Ive even checked it through run time, and each and every time, the process.processname changes. Any help will be greatly appreciated, thanks in advance.