Tutorial Level: Beginner: Launching other programs from your program.
Sometimes in programming you may want to launch something else from your program, such as notepad, or anything.
This is very simple to do and only takes a few lines of code.
1.) Create a new application. In the toolbox, go under the "Components" Tab and add a "Process"
2.) Ok now we have to tell Visual Basic the other file we want to launch, in this case, ill use Notepad.
To do this, click on the process (notice when you added it to the form, it wasn't on the form, it was placed down below). Now in the properties you
need to find, start info, and click on the little plus sign, to make all the Sub-Properties appear.
3.) You'll need to type the file path, and the directory that it is in here:
4.) Now add a button, get to its code view, and type this code:
The above code, associated the process with the program, and of course, started the process that we selected back in the properties.
5.) We can also terminate that process, add another button, and get to its code-view, type:
For some reason, Process1.Close does not work.