Click here to Skip to main content
13,597,485 members
Click here to Skip to main content
Add your own
alternative version

Tagged as


4 bookmarked
Posted 15 Dec 2012
Licenced CPOL

How to kill any process using VB.NET

, 13 Mar 2013
Rate this:
Please Sign up or sign in to vote.
Kill any process using VB.NET.


This article is useful for people who want to kill an irritating process using VB.NET. By the way I am using VB.NET 2010.

Using the Code

I know that most people try Formx_load but that kills the program only for once. It can be restarted if Windows allows it. Using this code maybe you will be able to kill an annoying program.

Therefore we use a timer.

Why a Timer?

We are using a timer because the event Formx_load occurs only once but the event Timerx_Tick occurs every second or millisecond. Therefore it kills the program many times until Windows fails to restart it. Remember that this is for experimental purposes only.

The code:   

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As DevComponents.DotNetBar.ClickEventArgs)
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    For Each prog As Process In Process.GetProcesses
        If prog.ProcessName = "ProcessName" Then
        End If

You cant paste it into your form.... 

Points of Interest

I was trying to kill a virus which used to run at startup and kill Windows Explorer. I tried to disable it from msconfig but again and again it prompted up and then I found this method!!! 


  • Article posted: 15/12/2012 6:30 PM.


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


About the Author

Singapore Singapore
<empty space="">

You may also be interested in...


Comments and Discussions

GeneralMy vote of 1 Pin
Sergey Alexandrovich Kryukov13-Jul-13 18:44
mvpSergey Alexandrovich Kryukov13-Jul-13 18:44 
GeneralMy vote of 2 Pin
Klaus Luedenscheidt13-Mar-13 20:10
memberKlaus Luedenscheidt13-Mar-13 20:10 
GeneralGood Pin
Globin22-Dec-12 10:35
memberGlobin22-Dec-12 10:35 
QuestionGood idea Pin
Tarek Elqusi16-Dec-12 21:48
memberTarek Elqusi16-Dec-12 21:48 
This is a good idea, you can improve your program by adding a list of processes names in a text file or xml as a metadata

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web02-2016 | 2.8.180621.3 | Last Updated 13 Mar 2013
Article Copyright 2012 by sid2x
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid