Error trying to run programs from System.Diagnostics.blah blah blah

andycharger

Well-known member
Joined
Apr 2, 2003
Messages
152
im trying to launch a text file document from vb.net using the code below:
Code:
However, when I press the button, I get the following message during debugging.

An unhandled exception of type System.ComponentModel.Win32Exception occurred in system.dll

Additional information: The system cannot find the file specified


However, the file is there.

Anyone got any ideas?
 
Sorry, code attached

Code:
   Private Sub Button1_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.MouseHover
        System.Diagnostics.Process.Start("C:\odbcconf.txt")
    End Sub

This is the VB code im using!
 
I just tried your code and it worked fine.

Is the spelling of the text file in your code exactly the same as the saved text file?
 
I just copy and pasted the code into a new vb project, changed the path to "C:\boot.ini" - I knew that file was there and it worked fine.

Only thing I can think of is that the file isnt there.
 
Enable viewing file extensions for common types in your Windows and look if the file is not named "odbcconf.txt.txt", i get this problem sometimes.
 
Back
Top