Google Answers Logo
View Question
 
Q: Error when changing default browser (windows cannot find [targetFile])($30) ( No Answer,   0 Comments )
Question  
Subject: Error when changing default browser (windows cannot find [targetFile])($30)
Category: Computers > Programming
Asked by: ronlohse-ga
List Price: $30.00
Posted: 13 Nov 2003 06:59 PST
Expires: 13 Dec 2003 06:59 PST
Question ID: 275436
I have written a sample VB.NET browser app using the MS Explorer COM
component (shdocvw.dll).  The app accepts a filename from the
commandline and navigates to it.  Browsing works fine.

I included in the app the ability to set it as the default browser.  I
suspect that this is where the problem exists.  The code I am using is
this:

Dim aKey As Microsoft.Win32.RegistryKey
'Set the htmlfile open command
aKey = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("\htmlfile\shell\open\command")
aKey.SetValue("", Application.ExecutablePath & " ""%1""")

'Set the opennew command
aKey = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("\htmlfile\shell\opennew\command")
aKey.SetValue("", """" & Application.ExecutablePath & """ %1")

'Set the secure open command
aKey = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("\https\shell\open\command")
aKey.SetValue("", Application.ExecutablePath & " ""%1""")

'Set the http open command
aKey = Microsoft.Win32.Registry.ClassesRoot.CreateSubKey("\http\shell\open\command")
aKey.SetValue("", Application.ExecutablePath & " ""%1""")

When I double click on an HTML file, I get an OS messagebox that reads
'Windows cannot find (myfile.html). Make sure you have typed the name
correctly and try again'

However, my sample browser DOES open and it DOES navigate to myfile.html.  

If I set IE as my default browser, everything returns to working as normal.

The basic question is this: Do I need to do something differently in
the registry to make this work or does my application need something
else to tell the OS it has found the file and is processing it?

This is a very small VB.NET app that I will gladly e-mail to whomever
takes this question.

Many thanks.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy