Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hello code project
i hope all good
i have problem with
how to get Place run process
for example
explorer = c:\windows\explorer.exe


VB
Private Sub lsproirtem()
    Dim ps() As Process
    Try
        ps = Process.GetProcesses()
        listpro.BeginUpdate()
        listpro.Clear()
        listpro.Columns.Add("Name", 150, HorizontalAlignment.Left)
        listpro.Columns.Add("ID", 60, HorizontalAlignment.Left)
        listpro.Columns.Add("Priority", 60, HorizontalAlignment.Right)
        listpro.Columns.Add("Memory", 100, HorizontalAlignment.Right)
        listpro.Columns.Add("patch Process", 250, HorizontalAlignment.Right)
 
        Dim p As Process
        For Each p In ps
            Dim lvi As ListViewItem = New ListViewItem()
            lvi.Text = p.ProcessName.ToString
            lvi.SubItems.Add(p.Id.ToString)
            lvi.SubItems.Add(p.BasePriority.ToString())
            lvi.SubItems.Add(p.WorkingSet64.ToString())
            lvi.SubItems.Add(code get Place run here )
            listpro.Items.Add(lvi)
        Next p
        listpro.EndUpdate()
    Catch e As Exception
        MessageBox.Show(e.Message)
    End Try
End Sub


thank you so much

What I have tried:

im tried with how to get lapce to process
Posted
Updated 23-Sep-16 7:07am
Comments
[no name] 23-Sep-16 10:52am    
Doing a teeny tiny bit of research goes a long way, process.MainModule.FileName

1 solution

refer this
c# - Getting a path of a running process by name - Stack Overflow[^]
the code is in C#, however you can use the logic to write in VB.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900