Running a program

hellven

Member
Joined
Oct 12, 2006
Messages
6
Programming Experience
Beginner
Hello!

How would I go about running a program located at a specific location on my hard-drive upon the click of a button?

I found this code on the internet for runing notepad:

Dim objShell
objShell = CreateObject("WScript.Shell")
objShell.Run("notepad")

How would i do that if the application has a specific path?
 
Give the following a try:

VB.NET:
Dim p As System.Diagnostics.Process = New System.Diagnostics.Process()
p.Start("c:\winnt\notepad.exe")
 
The Start method of Process class is Shared, you don't have to create an instance to use it, and generally you don't create an instance of a class unless you have a specific need for one. Usage example:
VB.NET:
Process.Start("c:\folder\app.exe")
 
Back
Top