VB Basic does not run .exe

1

I have a Launcher made in VB, which has to run an .exe file but it does not. And if I create a shortcut to that .exe and execute it if it works. But it does not work for me because direct access does not work on other computers.

This is how I execute it:

If ComboBox1.Text = "800x600" Then
        Dim sw As New System.IO.StreamWriter(Application.StartupPath & "\application.windows64\data\resolucion.txt", False, System.Text.Encoding.GetEncoding(437))
        sw.WriteLine("800")
        sw.WriteLine("600")
        sw.Close()
        Me.Hide()

        Process.Start(Application.StartupPath & "\application.windows64\Juego.exe")
    End If

    
asked by Tutee United 26.10.2017 в 16:05
source

1 answer

1

It is possible that the problem is not to establish the working directory of the application you want to run. Try this code:

Change:

Process.Start(Application.StartupPath & "\application.windows64\Juego.exe")

by:

Dim startInfo = New ProcessStartInfo(Application.StartupPath & "\application.windows64\Juego.exe")
startInfo.WorkingDirectory = Application.StartupPath & "\application.windows64\ "
Process.Start(startInfo)
    
answered by 26.10.2017 / 16:15
source