VB.NET

Moderators: seancampbell
Number of threads: 4022
Number of posts: 10035

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Running EXE in VB.NET Posted by Martok867 on 17 Jun 2012 at 10:07 PM
Sorry if this has been posted before but I'm new.

I'm trying to run and EDXE from a button click but nothing happens.
I've tried a few approches but its not working, what am I doing wrong?
As you can see I have just called it via Process.Start as well as defining it as its own process.........


Private Sub APP123_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles APP123.Click

'Enable error-handling routine
On Error GoTo ErrorHandler

'Check the APP123.EXE is in the corredct path
If System.IO.File.Exists(Application.StartupPath & "\APP123.exe") = False Then Err.Number = 1
GoTo ErrorHandler

'Open the APP123.exe file
Dim APP123Process As New Process
APP123Process.StartInfo.UseShellExecute = False
APP123Process.StartInfo.WorkingDirectory = Application.StartupPath
APP123Process.StartInfo.FileName = "\APP123.exe"
APP123Process.StartInfo.CreateNoWindow = True
APP123Process.Start()
'Dim APP123_PATH As String
'APP123_PATH = Application.StartupPath

'System.Diagnostics.Process.Start(Application.StartupPath & "\APP123.exe")


Exit Sub

'Error Handling Routine

ErrorHandler:
Select Case Err.Number 'Evaluate the error number.
Case 1 'File is missing
MsgBox("The requested file is missing")
MsgBox("The app startup path is " & Application.StartupPath)

Resume Next ' Resume Execution at the same line that caused the error
End Select


End Sub
Thread Tree
Martok867 Running EXE in VB.NET on 17 Jun 2012 at 10:07 PM



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.