Shell Execute to open a URL

W

Waldy

Hi there,
why can't I open a browser window with a URl using
ShellExecute? I have tried every combination of File, Parameters and
Operation but it never works. You can enter the following:

iexplore http://www.microsoft.com

in Start / Run and it will launch, so why not from ShellExecute?
 
N

Nicholas Paldino [.NET/C# MVP]

Waldy,

Are you specifically trying to get ie to open the url, or the default
browser? Either way, you should be using the Process class in the
System.Diagnostics namespace to start the process. If you want IE to open
the URL, you can pass iexplore as the executable name. If you want the
default browser, then you should be passing the URL to the Process class and
the OS will determine how to open the URL.
 

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