# How do you end a process using vb.net?

**URL:** <https://forums.thehomestack.io/t/how-do-you-end-a-process-using-vb-net/190>\
**Category:** vb.Net\
**Created:** [December 20, 2004, 3:17am UTC](https://forums.thehomestack.io/t/how-do-you-end-a-process-using-vb-net/190 "2004-12-20T03:17:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://forums.thehomestack.io/uploads/default/original/1X/161426793bc0d8bdf0d1a6692b3e44446861cc72.jpeg) [@system](https://forums.thehomestack.io/u/system)\
**Post date:** [December 20, 2004, 3:17am UTC](https://forums.thehomestack.io/t/how-do-you-end-a-process-using-vb-net/190/1 "2004-12-20T03:17:00Z")

</div>

I know you can start a process using this:

```auto

System.Diagnostics.Process.Start("Explorer.exe")

```

You can use this:

```auto

Dim myProcess As Process = Process.Start("Explorer.exe") 
        ' yadahyadah 
        ' yadahyadah 
        ' yadahyadah 
        myProcess.CloseMainWindow 

```

Or

```auto

Dim myProcessList As Process() = Process.GetProcessByName("Notepad") 
        Dim myProcess As Process 
        For Each myProcess In myProcessList 
            MyProcess.CloseMainWindow 
            MyProcess.Close 
        Next 

```

Or

```auto

'Kill all running process of Word and Excel. 
        'This is done because of problems with concurrent running Office processes. 
        For Each processXP In processList 
            If processXP.ProcessName = "WINWORD" Or processXP.ProcessName = "EXCEL" Then 
                processXP.Kill() 
            End If 
        Next 

```

Hope this helps
