VB.NET Beginner Tutorial – Start and Kill Programs and Processes (Visual Basic .NET)

In this Visual Basic .NET beginner tutorial, I will show you how to easily open and close other programs from within your application. I will also teach you about key differences between the closing methods CloseMainWindow() and Kill().

Tutorial Project Source Code:

Thank you for supporting VBToolbox! 🙂


Shajib Khan says:

Peace be unto you..Sir you are great and your tutorial also awsome

Patrick McDonald says:

Very good.

Ahmed Mohammed says:

Thank you very much.. i have been waiting for your amazing tutorials.

Raven Saint says:

Since I don’t know how to message through youtube. I have a question. How would I use a If string to check if a filter is checked and if it is keep its filter while sorting. I’m new to this and have tight deadlines for assignments and the text book seems to be written for geniuses. Not much hands-on before being expected to know how to preserve filters and sorting from drop down menus. With no real instruction on how to bring the different codes together to do something similar. I’ve got 2 days to figure this out.

Paul Pltx says:

Thanks for your tutorials, they are all great !
As a french, I’m surprised that’s I can understand almost all of what you’re saying. :p

CK Wunch says:

I will add a tip otherwise a few people will drive themselves insane with a null reference error.
getprocessbyname(name) must be an array BECAUSE your process list is an array, this is why the guy who made this video puts a for / next loop.
The reason i add this is some people might want to make a toggle button.
The following code might look right, but would never work
if condition = true then
process start(yourprocess)
if condition = false then
end if

There are two reasons this wont work, firstly getprocessbyname only returns the name, so if you started notepad.exe getprocessbyname will return only “notepad”
The next reason is the error causing reason – when the toggle is activated the process string() isnt holding a value. (null reference)

The correct way is as he showed you, its mostly better to use close, less chance of dataloss. (and also closing a bunch of programs all at the same time one will be more than likely to have something u never intended to lose)

Remember his method will close or kill EVERY single open notepad.

getprocess.id is required then you need to change it to a string,
Now you store that as a live variable in one of the various methods available

Now when you come to close or kill notepad you can instead use
getprocessbyID (ID)
Now if you have 10 open notepads, only the one you want will close.

Hilarious President says:

Hi! Please help!

How can I make a button that will open an *.exe on its current location WITH parameters*?

season failure says:

sir, i have been just started visual basic and I can declare variable but I cant code to run program so how can i generate code? in window form application program give me idea to generate code

Kevi Music says:

my says win32exception was unhandled pls help

Andrew Tang says:


Michael Sichico says:

how to create a countdown timer

Sam Johnson says:

learn to program before you teach others

Siraz Shaikh says:

how do i kill a background process

Mihai-Sabin Dragnea says:

Thank’s also for ur tutorials. They’ve been really helpfull!!!!

Carlos Alberto Araujo says:

Amazing…. the way you make it all so simple and reachable to a quick understanding.
Thank you, VB Tooolbox,
Keep on !

GAT_ FMS says:

Delete a file that is in use by another process with VB.net?

Patrick McDonald says:

Very good.

viralshield says:

Oh, just use Visual Basic 6.0. VB6 is light years faster and smarter than VB.Net !

Ken Clemer Baltar says:

nice work keep it up sir btw the log thing i ment earlier was just a log in app

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!