# Process.start is causing error "The system cannot find the file specified." when IE i



## snbabu (Aug 24, 2004)

HI,

Process.start is causing error "The system cannot find the file specified." when IE is opened using ShDocvw.dll.

I am having a form with two buttons, one to open an html file and the other is to navigate a URL.

The following code is used to open the html file.

Private Sub OpenViewer_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenViewer.Click

Dim objProcess As New Process

objProcess.StartInfo.FileName = "c:\Example1.html"
objProcess.StartInfo.Verb = "open"
objProcess.StartInfo.CreateNoWindow = True

objProcess.Start()

End Sub

the above code is working fine as long as i am using only this button click. But in special scenario this is causing error "The system cannot find the file specified."

I am using ShDocvw.dll to open up the IE with a URL.

the folloing is the code using for that.

Private Sub OpenIE_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenIE.Click

Dim objBrowser As New SHDocVw.InternetExplorer

objBrowser.Visible = True
objBrowser.Navigate("URL")
objBrowser = Nothing
End Sub

Once if i click on "btnOpenIE" to Open the IE to navigate to a URL. After that click on "btnOpenViewer" to open the file using process.start is causing the error "The system cannot find the file specified."

The following is the error message and stack trace.

Message	"The system cannot find the file specified"

StackTrace	" at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at <Specified Location>

If any body can give the solution it would be greatful to you.

Thanks in Advance
Suresh Babu


----------

