Launching an External .exe program

Hi,

I have a .exe program that I would like to run by pressing a button on my VB form. It seems simple enough, and I am trying to use the code given in the MS help file:

Tools.Shell """C:\Program Files\SomeFile.exe"""

However, VB is saying that Tools is not declared - which makes sense. What type of variable should Tools be dim'd as

Thanks in Advance,

Ken


Answer this question

Launching an External .exe program

  • Swarna

    Process.Start will do this for you in Vb.NET.



  • graab

    Drag button1 on form1 and insert Orange Code.... Cheers

    Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Process.Start("calc")
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    End Class


  • SithKitty

    Microsoft.VisualBasic.Interaction.Shell(String, [Microsoft.VisualBasic.AppWinStyle], [Boolean], [Integer]) As Integer

    More information is available in the Object Browser.



  • Launching an External .exe program