[TUT] Task Killing [vb.NET]

Reputation
0
Hey, and welcome to my very small tutorial on how to kill a process. Which could be a nice extra feature on your maleware.


First we are going to declare a variable Task() As Process:
Code:
Dim Task() As Process

Then we want to search for the process we want to kill (example: taskmgr, msconfig,..)
Code:
Task = Process.GetProcessesByName("taskmgr")

Then we simply want to stop it;
Code:
Task(0).Kill()

And you might want to add a Catch Exception around the task kill line;
Code:
            Try
                Task(0).Kill()
            Catch
            End Try

And we're done, lol so easy I know right.

Which makes the final code:

Code:
        Dim Task() As Process
        Task = Process.GetProcessesByName("taskmgr")
        Try
            Task(0).Kill()
        Catch
        End Try

You can change taskmgr to any process name.

Hope you can use this ^^
 
Back
Top