Question Kiling all process in a listbox

avreca-mortua

Member
Joined
Sep 4, 2012
Messages
6
Programming Experience
Beginner
Well I have a little app that gets some process names from a txt and put it on a listbox:

Dim a As String = My.Computer.FileSystem.ReadAllText("txtfile.txt")
Dim b As String() = a.Split(vbNewLine)
ListBox1.Items.AddRange(b)

everything is working fine with that but I want to do something like:

For Each Process As Process In ListBox1.Items
Process.Kill()

I have tried many codes but I can't please help me i'm a beginner and sorry for my english
 
What do you mean by 'process names'? Filepaths for executables?

Are you starting these processes from within your program?
 
I have a listbox with some process names like

cmd
notepad
winword

and I want to kill the entire list of process

I don't want the filepaths and yes i'm starting this processes with my program but I can't use the process.kill
coz' I start a bat and then the bat starts an emulator with some image or rom and that would only kill the cmd
only killing process for each item thanks for the reply
 
For Each p As Process In Process.GetProcesses()
    For Each item As String In ListBox1.Items

        If item = p.ProcessName Then p.Kill()

    Next
Next
 
Back
Top