Process.Start

L

lakepeir

Hello,

I'm trying to launch a text file in the Notepad application. When I
click the menu item, the application is not launched and the text file
is not launched. Listed below is the code.

Code:

Private Sub MenuItem_Help_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MenuItem_Help.Click
'Process.Start("Notepad.exe", "Help.txt")
End Sub
 
H

Herfried K. Wagner [MVP]

I'm trying to launch a text file in the Notepad application. When I
click the menu item, the application is not launched and the text file
is not launched. Listed below is the code.

Code:

Private Sub MenuItem_Help_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MenuItem_Help.Click
'Process.Start("Notepad.exe", "Help.txt")
End Sub

The line is commented out. Remove the "'" character in front of it.
 
L

lakepeir

Oops. Sorry. I have modified the code by adding some additional
implementation and commenting that line out. The actual code is not
commented out. It still doesn't launch the application.
Thanks.
 
B

Bruce W. Darby

Lakepier,

This may sound a bit simplistic, but is the path to the Help.txt file on the
local machine? Or is it on a network?

Bruce

Oops. Sorry. I have modified the code by adding some additional
implementation and commenting that line out. The actual code is not
commented out. It still doesn't launch the application.
Thanks.
 
T

Tom Leylan

Seriously this is only one line of code what could be programmed wrong?
It's not ASP code right?

Here is what you do to debug these things.

1) trace it with the debugger and make certain the event fires and that line
executes.
2) spell notepad.exe as "errorpad.exe" and see if it fails.
3) substitute any other app you have installed for notepad and see if it
works.
4) open a new project, add a new form, add a new button and put the notepad
code in that one.

Let us know what happened.

Oops. Sorry. I have modified the code by adding some additional
implementation and commenting that line out. The actual code is not
commented out. It still doesn't launch the application.
Thanks.
 
L

lakepeir

It's on a local machine.
Bruce said:
Lakepier,

This may sound a bit simplistic, but is the path to the Help.txt file on the
local machine? Or is it on a network?

Bruce
 
L

lakepeir

Thank you! It works. I put a breakpoint in the method and it never
executed. The code was in the incorrect method.
Tom said:
Seriously this is only one line of code what could be programmed wrong?
It's not ASP code right?

Here is what you do to debug these things.

1) trace it with the debugger and make certain the event fires and that line
executes.
2) spell notepad.exe as "errorpad.exe" and see if it fails.
3) substitute any other app you have installed for notepad and see if it
works.
4) open a new project, add a new form, add a new button and put the notepad
code in that one.

Let us know what happened.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top